From: Eric Wong Date: Tue, 3 Oct 2023 06:43:49 +0000 (+0000) Subject: lei: workers exit after they tell lei-daemon X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ed646e22f30102c89fa481aa0d64629e4ccb33ac;p=thirdparty%2Fpublic-inbox.git lei: workers exit after they tell lei-daemon We don't want workers continuing after their stdout has triggered EPIPE or some other write error. This fixes xt/lei-onion-convert.t to ensure the quit_waiter_pipe is fully-closed at daemon teardown during tests. Using the `exit' perlop still ensures OnDestroy callbacks will fire. --- diff --git a/lib/PublicInbox/LEI.pm b/lib/PublicInbox/LEI.pm index 817772f75..10c08b905 100644 --- a/lib/PublicInbox/LEI.pm +++ b/lib/PublicInbox/LEI.pm @@ -485,6 +485,7 @@ sub x_it ($$) { stop_pager($self); if ($self->{pkt_op_p}) { # worker => lei-daemon $self->{pkt_op_p}->pkt_do('x_it', $code); + exit($code >> 8); } elsif ($self->{sock}) { # lei->daemon => lei(1) client send($self->{sock}, "x_it $code", 0); } elsif ($quit == \&CORE::exit) { # an admin (one-shot) command