Process: Clean up process table entry even when kill(2) fails with ESRCH (#10375)

* Icinga daemon leaves zombie processes on very busy system

On a very heavily loaded system the process group kill can
be delayed until after the regular TERM signal has caused
the process to exit. In this situation the waitpid call
is valid and reaps the zombie process that would otherwise
be left behind.

* Update AUTHORS file
This commit is contained in:
Richard Mortimer 2025-03-18 10:29:00 +00:00 committed by GitHub
parent 5e902fe4a7
commit 63926c6e0d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 1 deletions

View File

@ -242,6 +242,7 @@ pv2b <pvz@pvz.pp.se>
Ralph Breier <ralph.breier@roedl.com> Ralph Breier <ralph.breier@roedl.com>
Reto Zeder <reto.zeder@arcade.ch> Reto Zeder <reto.zeder@arcade.ch>
Ricardo Bartels <ricardo@bitchbrothers.com> Ricardo Bartels <ricardo@bitchbrothers.com>
Richard Mortimer <richm@oldelvet.org.uk>
Rinck H. Sonnenberg <r.sonnenberg@netson.nl> Rinck H. Sonnenberg <r.sonnenberg@netson.nl>
Robert Lindgren <robert.lindgren@gmail.com> Robert Lindgren <robert.lindgren@gmail.com>
Robert Scheck <robert@fedoraproject.org> Robert Scheck <robert@fedoraproject.org>

View File

@ -1087,7 +1087,9 @@ bool Process::DoEvents()
Log(LogWarning, "Process") Log(LogWarning, "Process")
<< "Couldn't kill the process group " << m_PID << " (" << PrettyPrintArguments(m_Arguments) << "Couldn't kill the process group " << m_PID << " (" << PrettyPrintArguments(m_Arguments)
<< "): [errno " << error << "] " << strerror(error); << "): [errno " << error << "] " << strerror(error);
could_not_kill = true; if (error != ESRCH) {
could_not_kill = true;
}
} }
#endif /* _WIN32 */ #endif /* _WIN32 */