]> Sergey Matveev's repositories - public-inbox.git/commitdiff
lei_xsearch: ensure curl.err and tail(1) cleanup happens
authorEric Wong <e@80x24.org>
Tue, 2 Feb 2021 11:46:58 +0000 (11:46 +0000)
committerEric Wong <e@80x24.org>
Wed, 3 Feb 2021 07:32:42 +0000 (07:32 +0000)
We can safely rely on exit(0) here when interacting with curl(1)
and git(1), unlike query workers which hit Xapian directly,
where some badness happens when hit with a signal while
retrieving an mset.

lib/PublicInbox/LeiXSearch.pm

index b3cace74916cd442ffb19ea5a3b1d89feb78b760..e207f0fc0a61b7b47049bc3df4a4a048f9031554 100644 (file)
@@ -198,6 +198,7 @@ sub query_remote_mboxrd {
        my ($self, $lei, $uris) = @_;
        local $0 = "$0 query_remote_mboxrd";
        $lei->atfork_child_wq($self);
+       local $SIG{TERM} = sub { exit(0) }; # for DESTROY (File::Temp, $reap)
        my ($opt, $env) = @$lei{qw(opt env)};
        my @qform = (q => $lei->{mset_opt}->{qstr}, x => 'm');
        push(@qform, t => 1) if $opt->{thread};