lei-daemon (the top-level daemon process) should not have
synchronous waits, and this was causing a deadlock with
interrupted commands. There may still be a bug lurking in
lei/store despite this fix, though. I originally thought commit
fd261b9e65674505 (lei_store_err: use level-trigger for error pipe, 2022-08-15)
was sufficient, but at least this change is needed, as well.
return unless $lei->{sto};
local $current_lei = $lei;
my $sock = $wq ? $wq->{lei_sock} : undef;
- eval {
- if ($sock //= $lei->{sock}) { # issue, async wait
- $lei->{sto}->wq_io_do('done', [ $sock ]);
- } else { # forcibly wait
- my $wait = $lei->{sto}->wq_do('done');
- }
- };
+ $sock //= $lei->{sock};
+ my @io;
+ push(@io, $sock) if $sock; # async wait iff possible
+ eval { $lei->{sto}->wq_io_do('done', \@io) };
warn($@) if $@;
}