about summary refs log tree commit homepage
diff options
context:
space:
mode:
-rw-r--r--lib/PublicInbox/LEI.pm9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/PublicInbox/LEI.pm b/lib/PublicInbox/LEI.pm
index 52ce8ec2..3468094f 100644
--- a/lib/PublicInbox/LEI.pm
+++ b/lib/PublicInbox/LEI.pm
@@ -387,7 +387,14 @@ my @WQ_KEYS = qw(lxs l2m wq1); # internal workers
 
 sub _drop_wq {
         my ($self) = @_;
-        for my $wq (grep(defined, delete(@$self{@WQ_KEYS}))) { $wq->DESTROY }
+        for my $wq (grep(defined, delete(@$self{@WQ_KEYS}))) {
+                if ($wq->wq_kill) {
+                        $wq->wq_close(0, undef, $self);
+                } elsif ($wq->wq_kill_old) {
+                        $wq->wq_wait_old(undef, $self);
+                }
+                $wq->DESTROY;
+        }
 }
 
 # pronounced "exit": x_it(1 << 8) => exit(1); x_it(13) => SIGPIPE