about summary refs log tree commit homepage
path: root/lib/PublicInbox
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2021-10-21 21:10:21 +0000
committerEric Wong <e@80x24.org>2021-10-22 00:54:37 +0000
commit08b96c8dc9aa8cfd67a62fcfc3541bed14fce6bc (patch)
tree55def96d98e9f275c26ffed3b8c07fd726218856 /lib/PublicInbox
parent115f68f1e7aff78c27fdeec642e52294fcf20ad8 (diff)
downloadpublic-inbox-08b96c8dc9aa8cfd67a62fcfc3541bed14fce6bc.tar.gz
The lei/store process should only exit from EOF on the
socket, so make sure we note any unintended signals
Diffstat (limited to 'lib/PublicInbox')
-rw-r--r--lib/PublicInbox/LeiStore.pm8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/PublicInbox/LeiStore.pm b/lib/PublicInbox/LeiStore.pm
index 82104570..16e7d302 100644
--- a/lib/PublicInbox/LeiStore.pm
+++ b/lib/PublicInbox/LeiStore.pm
@@ -571,6 +571,12 @@ sub recv_and_run {
         $self->SUPER::recv_and_run(@args);
 }
 
+sub _sto_atexit { # dwaitpid callback
+        my ($args, $pid) = @_;
+        my $self = $args->[0];
+        warn "lei/store PID:$pid died \$?=$?\n" if $?;
+}
+
 sub write_prepare {
         my ($self, $lei) = @_;
         $lei // die 'BUG: $lei not passed';
@@ -587,7 +593,7 @@ sub write_prepare {
                                         -err_wr => $w,
                                         to_close => [ $r ],
                                 });
-                $self->wq_wait_async; # outlives $lei
+                $self->wq_wait_async(\&_sto_atexit); # outlives $lei
                 require PublicInbox::LeiStoreErr;
                 PublicInbox::LeiStoreErr->new($r, $lei);
         }