Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix interrupted scans (backport #832) #836

Merged
merged 8 commits into from
Aug 9, 2021

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented Aug 9, 2021

This is an automatic backport of pull request #832 done by Mergify.
Cherry-pick of 0dbce72 has failed:

On branch mergify/bp/middleware/pr-832
Your branch is ahead of 'origin/middleware' by 4 commits.
  (use "git push" to publish your local commits)

You are currently cherry-picking commit 0dbce72d.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	modified:   src/attack.c
	modified:   src/pluginlaunch.c

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   CHANGELOG.md

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/github/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally


Mergify commands and options

More conditions and actions can be found in the documentation.

You can also trigger Mergify actions by commenting on this pull request:

  • @Mergifyio refresh will re-evaluate the rules
  • @Mergifyio rebase will rebase this PR on its base branch
  • @Mergifyio update will merge the base branch into this PR
  • @Mergifyio backport <destination> will backport this PR on <destination> branch

Additionally, on Mergify dashboard you can:

  • look at your merge queues
  • generate the Mergify configuration with the config editor.

Finally, you can contact us on https://mergify.io/

Fix SC-177

On some cases, the parallel scan is disabled and,
the max_running_processes variable is set to 1, while the current number of
running process is grether than 1. Therefore, condition in the while loop are
not satisfied and never wait for free slot. At the end, the process table is full,
and this produced the host scan process to stop, because not free slot for a new process.

(cherry picked from commit dd3e46d)
This allows to handle the the error in a different way as for fork() issues (-1).

(cherry picked from commit 57c867b)
Because ERR_CANT_FORK should be used when there are resource issues, and when
the system is not being able to fork a new processes.

ERR_NO_FREE_SLOT is an internal error of the host scan process, which could be in most cases a temporal issue.
We don't stop the host scan process. We just try again until the process table has a free slot.

(cherry picked from commit ad3bd82)
(cherry picked from commit 0dbce72)

# Conflicts:
#	CHANGELOG.md
(cherry picked from commit 61c76a4)
Improve messages and docstrings.
Set warning log level instead of debug log level for plugin_launch error messages.

(cherry picked from commit b43156e)
@mergify mergify bot requested a review from a team as a code owner August 9, 2021 10:38
@mergify mergify bot added the conflicts This backport pull request has merge conflicts that need to be resolved label Aug 9, 2021
@jjnicola jjnicola enabled auto-merge August 9, 2021 11:43
@jjnicola jjnicola merged commit 0ceb1d6 into middleware Aug 9, 2021
@jjnicola jjnicola deleted the mergify/bp/middleware/pr-832 branch August 9, 2021 11:44
@jjnicola jjnicola added conflicts-resolved Conflicts in this pull request were solved and removed conflicts This backport pull request has merge conflicts that need to be resolved labels Aug 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
conflicts-resolved Conflicts in this pull request were solved
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant