[Catalyst] FastCGI Manager, Apache and SIGPIPE

Ruben Fonseca ruben.fonseca at log.pt
Sun Dec 23 23:35:10 GMT 2007


hi!

recently I've put a catalyst website into production using the  
following config:

- apache 2 + fastcgi running in external mode
- 1 fastcgi manager with 2 catalyst childs

the problem is that randomly, twice a day, the fastcgi manager shuts  
itself down. the only thing that appears on apache log is "FastCGI:  
server (pid 8122): safe exit after SIGTERM".

To dig more, I put the manager, and both the catalyst children under  
strace and found this:

- the first child (8121) receives a SIG_PIPE, and shuts down

8121  18:17:20 write(4, "\1\6\0\1\26J\6\0\"POST\">\n\t\t\t\t\t<input  
type"..., 5744) = -1 EPIPE (Broken pipe)
8121  18:17:20 --- SIGPIPE (Broken pipe) @ 0 (0) ---

(probably the client closed the connection earlier? I have no more  
data on strace about this process 8121, so it really ends here)

- the manager (8120) sees the child dying (8121) and kills the other  
child (8122)

8120  15:42:58 waitpid(-1, [{WIFSIGNALED(s) && WTERMSIG(s) ==  
SIGPIPE}], 0) = 8121
8120  18:17:20 --- SIGCHLD (Child exited) @ 0 (0) ---
8120  18:17:20 write(2, "FastCGI: manager (pid 8120): ser"..., 69) = 69
(...)
8120  18:17:20 kill(8122, SIGTERM)      = 0
8120  18:17:20 waitpid(-1, [{WIFEXITED(s) && WEXITSTATUS(s) == 0}],  
0) = 8122
8120  18:17:21 --- SIGCHLD (Child exited) @ 0 (0) ---

after this it shuts itself down too...

(...)
8120  18:17:21 exit_group(0)

Any hint here? Can you point me here's the problem? My bet is that  
the manager shouldn't abort when a child dies, or maybe catalyst  
dying on the SIG_PIPE is a bad behavior (or bug).

Please advice me. Thank you

Rúben






More information about the Catalyst mailing list