We'll also drop the "\n" for die() to make diagnostics easier.
There's no known bugs in this area, just consistency
improvements and LoC reduction.
---
 lib/PublicInbox/SearchIdxShard.pm | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/lib/PublicInbox/SearchIdxShard.pm 
b/lib/PublicInbox/SearchIdxShard.pm
index 831be51b..21bd56c2 100644
--- a/lib/PublicInbox/SearchIdxShard.pm
+++ b/lib/PublicInbox/SearchIdxShard.pm
@@ -32,12 +32,10 @@ sub new {
        $self;
 }
 
-sub _worker_done {
+sub _worker_done { # OnDestroy cb
        my ($self) = @_;
-       if ($self->need_xapian) {
-               die "$$ $0 xdb not released\n" if $self->{xdb};
-       }
-       die "$$ $0 still in transaction\n" if $self->{txn};
+       die "BUG: $$ $0 xdb active" if $self->need_xapian && $self->{xdb};
+       die "BUG: $$ $0 txn active" if $self->{txn};
 }
 
 sub ipc_atfork_child { # called automatically before ipc_worker_loop
@@ -64,7 +62,7 @@ sub echo {
 
 sub idx_close {
        my ($self) = @_;
-       die "transaction in progress $self\n" if $self->{txn};
+       die "BUG: $$ $0 txn active" if $self->{txn};
        $self->idx_release if $self->{xdb};
 }
 

Reply via email to