diff options
author | Eric Wong <e@80x24.org> | 2023-11-28 14:56:26 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2023-11-29 02:13:26 +0000 |
commit | 83655d5dd1679e7c44586aaae4e16a2bffdeaa1a (patch) | |
tree | 55f92d36e4e030cdb436b1cedc410d414cfc5358 | |
parent | beb39f037ee439c02f1c4a8e7b1e19ce7acca100 (diff) | |
download | public-inbox-83655d5dd1679e7c44586aaae4e16a2bffdeaa1a.tar.gz |
We don't want to be accessing uninitialized variables on process teardown since much of our control flow revolves around DESTROY for dependency handling.
-rw-r--r-- | lib/PublicInbox/CodeSearchIdx.pm | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/PublicInbox/CodeSearchIdx.pm b/lib/PublicInbox/CodeSearchIdx.pm index d49e9a8d..7d696099 100644 --- a/lib/PublicInbox/CodeSearchIdx.pm +++ b/lib/PublicInbox/CodeSearchIdx.pm @@ -338,6 +338,9 @@ sub shard_done { # called via PktOp on shard_index completion sub repo_stored { my ($self, $repo_ctx, $drs, $did) = @_; + # check @IDX_SHARDS instead of DO_QUIT to avoid wasting prior work + # because shard_commit is fast + return unless @IDX_SHARDS; $did > 0 or die "BUG: $repo_ctx->{repo}->{git_dir}: docid=$did"; my ($c, $p) = PublicInbox::PktOp->pair; $c->{ops}->{shard_done} = [ $self, $repo_ctx, @@ -509,6 +512,7 @@ sub shard_commit { # via wq_io_do sub dump_roots_start { my ($self, $do_join) = @_; + return if $DO_QUIT; $XHC //= PublicInbox::XapClient::start_helper("-j$NPROC"); $do_join // die 'BUG: no $do_join'; progress($self, 'dumping IDs from coderepos'); @@ -562,6 +566,7 @@ EOM sub dump_ibx_start { my ($self, $do_join) = @_; + return if $DO_QUIT; $XHC //= PublicInbox::XapClient::start_helper("-j$NPROC"); my ($sort_opt, $fold_opt); pipe(local $sort_opt->{0}, $DUMP_IBX_WPIPE); |