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 #832

Merged
merged 7 commits into from
Aug 9, 2021
Merged

Conversation

jjnicola
Copy link
Member

@jjnicola jjnicola commented Aug 6, 2021

SC-177

What:
Check if the max running process was reached or even exceed, when waiting for running a new plugin.

Why:
Fix an issue which produced interrupted scan, because a host not being scan 100%

How:
Not easy to reproduce. It depends on the system, scan config and mainly on the target system (some plugins must be trigger in a especial order). Good luck.

Checklist:

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.
This allows to handle the the error in a different way as for fork() issues (-1).
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.
src/pluginlaunch.c Outdated Show resolved Hide resolved
@jjnicola jjnicola requested a review from bjoernricks August 6, 2021 08:51
src/attack.c Outdated Show resolved Hide resolved
src/pluginlaunch.c Outdated Show resolved Hide resolved
src/pluginlaunch.c Outdated Show resolved Hide resolved
src/pluginlaunch.c Outdated Show resolved Hide resolved
src/attack.c Outdated Show resolved Hide resolved
src/attack.c Outdated Show resolved Hide resolved
Improve messages and docstrings.
Set warning log level instead of debug log level for plugin_launch error messages.
@jjnicola jjnicola merged commit e562400 into greenbone:openvas-21.04 Aug 9, 2021
@jjnicola jjnicola deleted the interrupted-scan branch August 9, 2021 10:37
jjnicola added a commit that referenced this pull request Aug 9, 2021
jjnicola added a commit that referenced this pull request Aug 9, 2021
jjnicola added a commit that referenced this pull request Aug 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants