]> git.ipfire.org Git - thirdparty/public-inbox.git/commitdiff
drop redundant calls to DS->Reset
authorEric Wong <e@80x24.org>
Sun, 26 Nov 2023 21:08:01 +0000 (21:08 +0000)
committerEric Wong <e@80x24.org>
Sun, 26 Nov 2023 21:08:25 +0000 (21:08 +0000)
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.

lib/PublicInbox/CodeSearchIdx.pm
lib/PublicInbox/Daemon.pm
lib/PublicInbox/IO.pm

index 3764f13e121ce6727bd3959dc4bc73ae76cbf828..bb1d698ba7f8834d0190038d34c529478dc3416b 100644 (file)
@@ -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);
 }
index f33f6f173ff292fec69371046f93bbdd83352496..a2c1ed6ea179a40d5a8a669dc4d7669c14c88649 100644 (file)
@@ -703,7 +703,6 @@ sub run {
        local %POST_ACCEPT;
 
        daemon_loop();
-       PublicInbox::DS->Reset;
        # ->DESTROY runs when $for_destroy goes out-of-scope
 }
 
index 6593dcdf8a5ae1047e080c8509093993de75768e..5654f3b0bebcfefe324ababa2872b14be3985870 100644 (file)
@@ -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 {