user/dev discussion of public-inbox itself
 help / color / mirror / code / Atom feed
* [PATCH] qspawn: fix process finalization for generic PSGI server
@ 2023-01-02  8:20 Eric Wong
  0 siblings, 0 replies; only message in thread
From: Eric Wong @ 2023-01-02  8:20 UTC (permalink / raw)
  To: meta

This fixes the inability to fallback to WwwCoderepo on cgit 404s
with generic PSGI servers.  Unfortunately, this doesn't seem to
get tested with generic PSGI tests, and doesn't happen on
public-inbox-httpd, obviously.
---
 lib/PublicInbox/Qspawn.pm | 5 +++--
 1 file 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)

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2023-01-02  8:20 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-02  8:20 [PATCH] qspawn: fix process finalization for generic PSGI server Eric Wong

Code repositories for project(s) associated with this public inbox

	https://80x24.org/public-inbox.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).