about summary refs log tree commit homepage
path: root/lib/PublicInbox/LEI.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2021-01-21 19:46:17 +0000
committerEric Wong <e@80x24.org>2021-01-22 16:18:01 -0400
commite2cb80c33b015c407c19cddc327dcb5c50137a0c (patch)
tree69d0f3d1bcf1f14c9c5c2daa1e013b7e6cba834d /lib/PublicInbox/LEI.pm
parent0bc18178bc8cd08a28befbb6b3d2e7cccfc62589 (diff)
downloadpublic-inbox-e2cb80c33b015c407c19cddc327dcb5c50137a0c.tar.gz
$wq->{-ipc_atfork_child_close} neededed to be initialized properly.
And start setting $0 in workers to improve visibility.
Diffstat (limited to 'lib/PublicInbox/LEI.pm')
-rw-r--r--lib/PublicInbox/LEI.pm9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/PublicInbox/LEI.pm b/lib/PublicInbox/LEI.pm
index 6be6d10b..2cb2bf40 100644
--- a/lib/PublicInbox/LEI.pm
+++ b/lib/PublicInbox/LEI.pm
@@ -281,11 +281,14 @@ sub fail ($$;$) {
 
 sub atfork_prepare_wq {
         my ($self, $wq) = @_;
-        my $tcafc = $wq->{-ipc_atfork_child_close};
+        my $tcafc = $wq->{-ipc_atfork_child_close} //= [];
         push @$tcafc, @TO_CLOSE_ATFORK_CHILD;
         if (my $sock = $self->{sock}) {
                 push @$tcafc, @$self{qw(0 1 2)}, $sock;
         }
+        if (my $pgr = $self->{pgr}) {
+                push @$tcafc, @$pgr[1,2];
+        }
         for my $f (qw(lxs l2m)) {
                 my $ipc = $self->{$f} or next;
                 push @$tcafc, grep { defined }
@@ -335,9 +338,7 @@ sub atfork_parent_wq {
         my $l2m = $ret->{l2m};
         if ($l2m && $l2m != $wq) { # $wq == lxs
                 $io[4] = $l2m->{-wq_s1} if $l2m->{-wq_s1};
-                if (my @pids = $l2m->wq_close) {
-                        $wq->{l2m_pids} = \@pids;
-                }
+                $l2m->wq_close(1);
         }
         ($ret, @io);
 }