1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
|
From 56f0eb7bbab1d09ee0d7b48056aa32877c56bcd9 Mon Sep 17 00:00:00 2001
From: Andrew Ruthven <andrew@etc.gen.nz>
Date: Wed, 1 Dec 2021 21:42:47 +1300
Subject: A client terminating a connection shouldn't kill a FCGI process
When a client disconnects before processing is complete than a SIGPIPE
is sent to the FCGI process. Previously this would cause the process
to exit. Discussed on the forum here:
* https://forum.bestpractical.com/t/rt-4-4-fastcgi-processes-frequently-dying/34812
* https://forum.bestpractical.com/t/why-does-rts-fcgi-server-not-handle-sigpipe/35902
Patch-Name: fcgi_client_sigpipe.diff
---
sbin/rt-server.fcgi | 3 +++
sbin/rt-server.in | 3 +++
2 files changed, 6 insertions(+)
diff --git a/sbin/rt-server.fcgi b/sbin/rt-server.fcgi
index a9f73599..9a9c286a 100755
--- a/sbin/rt-server.fcgi
+++ b/sbin/rt-server.fcgi
@@ -159,6 +159,9 @@ $SIG{INT} = sub {
exit 0;
} if $> == 0;
+# If a client goes away, don't allow this process to die.
+$SIG{PIPE} = 'IGNORE';
+
$r->run;
__END__
diff --git a/sbin/rt-server.in b/sbin/rt-server.in
index 871b66c6..56a93a15 100644
--- a/sbin/rt-server.in
+++ b/sbin/rt-server.in
@@ -159,6 +159,9 @@ $SIG{INT} = sub {
exit 0;
} if $> == 0;
+# If a client goes away, don't allow this process to die.
+$SIG{PIPE} = 'IGNORE';
+
$r->run;
__END__
|