about summary refs log tree commit homepage
path: root/lib/PublicInbox/LEI.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2021-09-25 05:49:44 +0000
committerEric Wong <e@80x24.org>2021-09-25 08:53:44 +0000
commit50417b5469245feef84789f0bb540a3780dc14b4 (patch)
treec828e75af8670cb26572cb0c7649db1fd6b550c0 /lib/PublicInbox/LEI.pm
parent9a32c4433b87eddc0f07e979faf64e0f8e025593 (diff)
downloadpublic-inbox-50417b5469245feef84789f0bb540a3780dc14b4.tar.gz
If the event loop fails, we want blocking waitpid (wait4) calls
to be interruptible with SIGTERM via "kill $PID" rather than
SIGKILL.  Though a failing event loop is something we should
avoid...
Diffstat (limited to 'lib/PublicInbox/LEI.pm')
-rw-r--r--lib/PublicInbox/LEI.pm2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/PublicInbox/LEI.pm b/lib/PublicInbox/LEI.pm
index 9d5a5a46..3ff8a347 100644
--- a/lib/PublicInbox/LEI.pm
+++ b/lib/PublicInbox/LEI.pm
@@ -1346,6 +1346,8 @@ sub lazy_start {
         # $daemon pipe to `lei' closed, main loop begins:
         eval { PublicInbox::DS->EventLoop };
         warn "event loop error: $@\n" if $@;
+        # exit() may trigger waitpid via various DESTROY, ensure interruptible
+        PublicInbox::DS::sig_setmask($oldset);
         dump_and_clear_log();
         exit($exit_code // 0);
 }