You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Issue is initially documented there : centreon/centreon-nsclient-build#28
NSClient++ does not properly kill all processes spawned by an external command, after timeout has been reached.
It only kills the parent process, leaving child processes hanging forever (which can be dangerous in terms of memory consumption etc...).
Lets' take for example the following nsclient.ini configuration :
[/settings/external scripts]
timeout=10
And an external command calling centreon_plugins.exe.
When the external command is launched by NSClient++, 2 new centreon_plugins.exe appear on the Windows machine, one parent, and one child.
If the child hangs, for whatever reason, timeout will be reached, and NSClient++ will kill the parent process.
But then the child process will hang forever.
Hi,
Issue and Steps to Reproduce
Issue is initially documented there : centreon/centreon-nsclient-build#28
NSClient++ does not properly kill all processes spawned by an external command, after timeout has been reached.
It only kills the parent process, leaving child processes hanging forever (which can be dangerous in terms of memory consumption etc...).
Lets' take for example the following
nsclient.ini
configuration :And an external command calling
centreon_plugins.exe
.When the external command is launched by NSClient++, 2 new
centreon_plugins.exe
appear on the Windows machine, one parent, and one child.If the child hangs, for whatever reason,
timeout
will be reached, and NSClient++ will kill the parent process.But then the child process will hang forever.
Expected Behavior
NSClient++ should kill the whole processes' tree.
I think it could be done there :
https://github.com/mickem/nscp/blob/0.5.2.41/include/process/execute_process_w32.cpp#L246
Instead of
TerminateProcess(pi.hProcess, ...
, and then instead of working on the first / parent process only, the whole process tree should rather be proceeded.Some guideline here : https://stackoverflow.com/questions/1173342/terminate-a-process-tree-c-for-windows
Details
Thank you 👍
The text was updated successfully, but these errors were encountered: