about summary refs log tree commit homepage
path: root/lib/PublicInbox/Git.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2024-04-01 06:49:38 +0000
committerEric Wong <e@80x24.org>2024-04-03 08:28:07 +0000
commita145f5acf90fff0b146e6e871925950f62fb426a (patch)
tree493ebdb7d2cb55fdba9b667c47d27f3a253f3d32 /lib/PublicInbox/Git.pm
parent108196adad5e70b6dd40dc431cd1033d44679483 (diff)
downloadpublic-inbox-a145f5acf90fff0b146e6e871925950f62fb426a.tar.gz
There are still some places where on_destroy isn't suitable,
This gets rid of getpid() calls in most of those cases to
reduce syscall costs and cleanup syscall trace output.
Diffstat (limited to 'lib/PublicInbox/Git.pm')
-rw-r--r--lib/PublicInbox/Git.pm8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/PublicInbox/Git.pm b/lib/PublicInbox/Git.pm
index af12f141..aea389e8 100644
--- a/lib/PublicInbox/Git.pm
+++ b/lib/PublicInbox/Git.pm
@@ -210,14 +210,14 @@ sub cat_async_retry ($$) {
 sub gcf_inflight ($) {
         my ($self) = @_;
         # FIXME: the first {sock} check can succeed but Perl can complain
-        # about calling ->owner_pid on an undefined value.  Not sure why or
-        # how this happens but t/imapd.t can complain about it, sometimes.
+        # about an undefined value.  Not sure why or how this happens but
+        # t/imapd.t can complain about it, sometimes.
         if ($self->{sock}) {
-                if (eval { $self->{sock}->owner_pid == $$ }) {
+                if (eval { $self->{sock}->can_reap }) {
                         return $self->{inflight};
                 } elsif ($@) {
                         no warnings 'uninitialized';
-                        warn "E: $self sock=$self->{sock}: owner_pid failed: ".
+                        warn "E: $self sock=$self->{sock}: can_reap failed: ".
                                 "$@ (continuing...)";
                 }
                 delete @$self{qw(sock inflight)};