From 7cb5dac3b11acf0d79f599a060cd56d3b73162b1 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Mon, 28 Nov 2022 05:32:17 +0000 Subject: lei_mirror: remove janky mirror.done stamp file This makes a fundamental (and overdue) change to the core of lei in how it handles child errors. Every process which generates or receives a child error will remember it before passing it on. This ensures _wq_done_wait callbacks will know of prior errors aside from $? when it runs. --- lib/PublicInbox/LEI.pm | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'lib/PublicInbox/LEI.pm') diff --git a/lib/PublicInbox/LEI.pm b/lib/PublicInbox/LEI.pm index 8a14ace4..b78d70de 100644 --- a/lib/PublicInbox/LEI.pm +++ b/lib/PublicInbox/LEI.pm @@ -544,12 +544,11 @@ sub child_error { # passes non-fatal curl exit codes to user local $current_lei = $self; $child_error ||= 1 << 8; warn(substr($msg, -1, 1) eq "\n" ? $msg : "$msg\n") if defined $msg; + $self->{child_error} ||= $child_error; if ($self->{pkt_op_p}) { # to top lei-daemon $self->{pkt_op_p}->pkt_do('child_error', $child_error); } elsif ($self->{sock}) { # to lei(1) client send($self->{sock}, "child_error $child_error", MSG_EOR); - } else { # non-lei admin command - $self->{child_error} ||= $child_error; } # else noop if client disconnected } -- cgit v1.2.3-24-ge0c7