From 2e755e0b5e3bc25b06055dce53009bfba4c0504b Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sun, 10 Jan 2021 12:15:15 +0000 Subject: lei: get rid of client {pid} field Using kill(2) is too dangerous since extremely long queries may mean the original PID of the aborted lei(1) client process to be recycled by a new process. It would be bad if the lei_xsearch worker process issued a kill on the wrong process. So just rely on sending the exit message via socket. --- lib/PublicInbox/LeiQuery.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/PublicInbox/LeiQuery.pm') diff --git a/lib/PublicInbox/LeiQuery.pm b/lib/PublicInbox/LeiQuery.pm index 040c284d..d5376be5 100644 --- a/lib/PublicInbox/LeiQuery.pm +++ b/lib/PublicInbox/LeiQuery.pm @@ -76,7 +76,7 @@ sub lei_q { } my $j = $opt->{jobs} // scalar(@srcs) > 4 ? 4 : scalar(@srcs); $j = 1 if !$opt->{thread}; - if ($self->{pid}) { + if ($self->{sock}) { $lxs->wq_workers_start('lei_xsearch', $j, $self->oldset) // $self->wq_workers($j); } -- cgit v1.2.3-24-ge0c7