Failures here can cause the lei-daemon event loop to break
since PktOp doesn't guard dispatch. Add a guard here (and
not deeper in the stack) so we can use the $lei object to
report errors.
---
lib/PublicInbox/LEI.pm | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/lib/PublicInbox/LEI.pm b/lib/PublicInbox/LEI.pm
index f0caac03..e529c86a 100644
--- a/lib/PublicInbox/LEI.pm
+++ b/lib/PublicInbox/LEI.pm
@@ -1500,12 +1500,15 @@ sub lms { # read-only LeiMailSync
sub sto_done_request { # only call this from lei-daemon process (not workers)
my ($lei, $sock) = @_;
- if ($sock //= $lei->{sock}) {
- $LIVE_SOCK{"$sock"} = $sock;
- $lei->{sto}->ipc_do('done', "$sock"); # issue, async wait
- } else { # forcibly wait
- my $wait = $lei->{sto}->ipc_do('done');
- }
+ eval {
+ if ($sock //= $lei->{sock}) { # issue, async wait
+ $LIVE_SOCK{"$sock"} = $sock;
+ $lei->{sto}->ipc_do('done', "$sock");
+ } else { # forcibly wait
+ my $wait = $lei->{sto}->ipc_do('done');
+ }
+ };
+ $lei->err($@) if $@;
}
sub sto_done_complete { # called in lei-daemon when LeiStore->done is complete
--
unsubscribe: one-click, see List-Unsubscribe header
archive: https://public-inbox.org/meta/