]> Sergey Matveev's repositories - public-inbox.git/commitdiff
httpd|nntpd: avoid missed signal wakeups
authorEric Wong <e@80x24.org>
Wed, 27 Nov 2019 01:33:33 +0000 (01:33 +0000)
committerEric Wong <e@80x24.org>
Wed, 27 Nov 2019 10:25:43 +0000 (10:25 +0000)
Our attempt at using a self-pipe in signal handlers was
ineffective, since pure Perl code execution is deferred
and Perl doesn't use an internal self-pipe/eventfd.  In
retrospect, I actually prefer the simplicity of Perl in
this regard...

We can use sigprocmask() from Perl, so we can introduce
signalfd(2) and EVFILT_SIGNAL support on Linux and *BSD-based
systems, respectively.  These OS primitives allow us to avoid a
race where Perl checks for signals right before epoll_wait() or
kevent() puts the process to sleep.

The (few) systems nowadays without signalfd(2) or IO::KQueue
will now see wakeups every second to avoid missed signals.


No differences found