mirror of
https://github.com/zeek/zeek.git
synced 2025-10-04 15:48:19 +00:00
Improved signal handling.
Sending SIGTERM triggers a normal shutdown of all threads that waits until they have processed their remaining data. However, sending a 2nd SIGTERM while waiting for them to finish will immediately kill them all.
This commit is contained in:
parent
ffb4094d36
commit
4879cb7b0d
5 changed files with 56 additions and 0 deletions
|
@ -333,6 +333,13 @@ RETSIGTYPE sig_handler(int signo)
|
|||
{
|
||||
set_processing_status("TERMINATING", "sig_handler");
|
||||
signal_val = signo;
|
||||
|
||||
if ( thread_mgr->Terminating() && (signal_val == SIGTERM || signal_val == SIGINT) )
|
||||
// If the thread manager is already terminating (i.e.,
|
||||
// waiting for child threads to exit), another term signal
|
||||
// will send the threads a kill.
|
||||
thread_mgr->KillThreads();
|
||||
|
||||
return RETSIGVAL;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue