-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
arbiter: Remove SIG_QUEUE and only use PIPE instead
Since memory allocations aren't recommended when we're in signal handling context, it's most likely unsafe to manipulate a python list inside such context. Instead, when we're in a signal handler, we write the signal number to a pipe, and then we read the pipe once we've exited the signal context. This way, we won't to any memory allocation in a signal context, as the handling takes place in the "normal" context. So after this commit, PIPE is used both for waking up the arbiter process (prematurely before the timeout has been reached), and for sending what incoming signal we've received.
- Loading branch information
Showing
1 changed file
with
22 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters