File: fcgi_client_sigpipe.diff

package info (click to toggle)
request-tracker4 4.4.6%2Bdfsg-1.1%2Bdeb12u3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm-proposed-updates
  • size: 63,472 kB
  • sloc: javascript: 130,444; perl: 65,299; sh: 1,322; makefile: 471; python: 37; php: 30
file content (46 lines) | stat: -rw-r--r-- 1,325 bytes parent folder | download | duplicates (2)
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 a7e042cf7587067c3ab84a89ad6d34df1fb13ed6 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 c91c7118..4c7f2a51 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__