File: fcgi_client_sigpipe.diff

package info (click to toggle)
request-tracker5 5.0.3%2Bdfsg-3~deb12u3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 77,648 kB
  • sloc: javascript: 187,930; perl: 79,061; sh: 1,302; makefile: 471; python: 37; php: 15
file content (46 lines) | stat: -rw-r--r-- 1,325 bytes parent folder | download
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__