about summary refs log tree commit homepage
diff options
context:
space:
mode:
-rw-r--r--lib/PublicInbox/Qspawn.pm5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/PublicInbox/Qspawn.pm b/lib/PublicInbox/Qspawn.pm
index 9ca6b3db..297a284f 100644
--- a/lib/PublicInbox/Qspawn.pm
+++ b/lib/PublicInbox/Qspawn.pm
@@ -233,9 +233,10 @@ sub psgi_return_init_cb {
         if (ref($r) ne 'ARRAY' || scalar(@$r) == 3) { # error
                 if ($async) { # calls rpipe->close && ->event_step
                         $async->close; # PublicInbox::HTTPD::Async::close
-                } else {
-                        $self->{rpipe}->close;
+                } else { # generic PSGI:
+                        delete($self->{rpipe})->close;
                         event_step($self);
+                        waitpid_err($self);
                 }
                 if (ref($r) eq 'ARRAY') { # error
                         $wcb->($r)