From 39d44555e3f04c97e98c7f5d3538bbba6a19656b Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Wed, 13 Jan 2021 19:06:15 -1200 Subject: lei: test SIGPIPE, stop xsearch workers on client abort The new test ensures consistency between oneshot and client/daemon users. Cancelling an in-progress result now also stops xsearch workers to avoid wasted CPU and I/O. Note the lei->atfork_child_wq usage changes, it is to workaround a bug in Perl 5: http://nntp.perl.org/group/perl.perl5.porters/258784 This switches the internal protocol to use SOCK_SEQPACKET AF_UNIX sockets to prevent merging messages from the daemon to client to run pager and kill/exit the client script. --- lib/PublicInbox/LeiOverview.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lib/PublicInbox/LeiOverview.pm') diff --git a/lib/PublicInbox/LeiOverview.pm b/lib/PublicInbox/LeiOverview.pm index 8a1f4f82..194c5e28 100644 --- a/lib/PublicInbox/LeiOverview.pm +++ b/lib/PublicInbox/LeiOverview.pm @@ -108,8 +108,9 @@ sub _unbless_smsg { sub ovv_atexit_child { my ($self, $lei) = @_; - my $bref = delete $lei->{ovv_buf} or return; - print { $lei->{1} } $$bref; + if (my $bref = delete $lei->{ovv_buf}) { + print { $lei->{1} } $$bref; + } } # JSON module ->pretty output wastes too much vertical white space, -- cgit v1.2.3-24-ge0c7