diff options
author | Eric Wong <e@80x24.org> | 2021-09-25 05:49:44 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2021-09-25 08:53:44 +0000 |
commit | 50417b5469245feef84789f0bb540a3780dc14b4 (patch) | |
tree | c828e75af8670cb26572cb0c7649db1fd6b550c0 /lib | |
parent | 9a32c4433b87eddc0f07e979faf64e0f8e025593 (diff) | |
download | public-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')
-rw-r--r-- | lib/PublicInbox/LEI.pm | 2 |
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); } |