From d6674af04cb74a4efd513d938bed8bf7ab2838eb Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Wed, 27 Nov 2019 01:33:33 +0000 Subject: httpd|nntpd: avoid missed signal wakeups 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. --- MANIFEST | 2 ++ 1 file changed, 2 insertions(+) (limited to 'MANIFEST') diff --git a/MANIFEST b/MANIFEST index a50c1246..098e656d 100644 --- a/MANIFEST +++ b/MANIFEST @@ -141,6 +141,7 @@ lib/PublicInbox/SearchIdxShard.pm lib/PublicInbox/SearchMsg.pm lib/PublicInbox/SearchThread.pm lib/PublicInbox/SearchView.pm +lib/PublicInbox/Sigfd.pm lib/PublicInbox/SolverGit.pm lib/PublicInbox/Spamcheck.pm lib/PublicInbox/Spamcheck/Spamc.pm @@ -266,6 +267,7 @@ t/replace.t t/reply.t t/search-thr-index.t t/search.t +t/sigfd.t t/solve/0001-simple-mod.patch t/solve/0002-rename-with-modifications.patch t/solver_git.t -- cgit v1.2.3-24-ge0c7