Skip to content

Commit

Permalink
Check if the max running process was reached or even exceed.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jjnicola committed Aug 6, 2021
1 parent cee2124 commit dd3e46d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/pluginlaunch.c
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ pluginlaunch_wait_for_free_process (kb_t kb)
/* Max number of processes are still running, wait for a child to exit or
* to timeout. */
while (
(num_running_processes == max_running_processes)
(num_running_processes >= max_running_processes)
|| (num_running_processes > 0 && (check_memory () || check_sysload ())))
{
sigset_t mask;
Expand Down

0 comments on commit dd3e46d

Please sign in to comment.