about summary refs log tree commit homepage
path: root/lib/PublicInbox
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2023-11-26 21:08:01 +0000
committerEric Wong <e@80x24.org>2023-11-26 21:08:25 +0000
commit13a7f10e585b0816e375f134f00a1d2fe9af4bd3 (patch)
tree670f6b010540cad82fa7c6f9732f708b9c70177d /lib/PublicInbox
parent51b2fa7fb2b7b1caed8b1dde4613992a192225ed (diff)
downloadpublic-inbox-13a7f10e585b0816e375f134f00a1d2fe9af4bd3.tar.gz
drop redundant calls to DS->Reset
Reset gets called on END{} anyways to workaround DBI lifetime
problems, so there's no need to call it near exit.  We can't
replace calls to POSIX::_exit with `exit' to force END{} to
run just yet, as there are still some lingering destruction
ordering problems on newer DBI and or Perls.
Diffstat (limited to 'lib/PublicInbox')
-rw-r--r--lib/PublicInbox/CodeSearchIdx.pm1
-rw-r--r--lib/PublicInbox/Daemon.pm1
-rw-r--r--lib/PublicInbox/IO.pm6
3 files changed, 2 insertions, 6 deletions
diff --git a/lib/PublicInbox/CodeSearchIdx.pm b/lib/PublicInbox/CodeSearchIdx.pm
index 3764f13e..bb1d698b 100644
--- a/lib/PublicInbox/CodeSearchIdx.pm
+++ b/lib/PublicInbox/CodeSearchIdx.pm
@@ -1292,7 +1292,6 @@ sub cidx_run { # main entry point
 
         local @PublicInbox::DS::post_loop_do = (\&shards_active);
         PublicInbox::DS::event_loop($MY_SIG, $SIGSET);
-        PublicInbox::DS->Reset;
         $self->lock_release(!!$NCHANGE);
         show_json($self);
 }
diff --git a/lib/PublicInbox/Daemon.pm b/lib/PublicInbox/Daemon.pm
index f33f6f17..a2c1ed6e 100644
--- a/lib/PublicInbox/Daemon.pm
+++ b/lib/PublicInbox/Daemon.pm
@@ -703,7 +703,6 @@ sub run {
         local %POST_ACCEPT;
 
         daemon_loop();
-        PublicInbox::DS->Reset;
         # ->DESTROY runs when $for_destroy goes out-of-scope
 }
 
diff --git a/lib/PublicInbox/IO.pm b/lib/PublicInbox/IO.pm
index 6593dcdf..5654f3b0 100644
--- a/lib/PublicInbox/IO.pm
+++ b/lib/PublicInbox/IO.pm
@@ -15,10 +15,8 @@ use Errno qw(EINTR EAGAIN);
 
 sub waitcb { # awaitpid callback
         my ($pid, $errref, $cb, @args) = @_;
-        $errref //= \my $workaround_await_pids_clobbered;
-        $$errref = $?; # sets .cerr for _close
+        $$errref = $? if $errref; # sets .cerr for _close
         $cb->($pid, @args) if $cb; # may clobber $?
-        $? = $$errref;
 }
 
 sub attach_pid {
@@ -52,7 +50,7 @@ sub close {
         } else { # wait synchronously
                 my $w = awaitpid($reap->[1]);
         }
-        $? ? '' : $ret; # use $?, AWAIT_PIDS may be cleared on ->Reset (FIXME?)
+        $? ? '' : $ret;
 }
 
 sub DESTROY {