Re: [Catalyst] fastcgi, production catalyst and sigpipe

2007-12-27 Thread Ruben Fonseca


On 2007/12/27, at 16:29, Bernhard Graf wrote:


The problem seemed to be related to the FastCGI's daemonize mode (-d):
http://catalyst.perl.org/calendar/2007/18 - Caveats

In last year's advent calender JR gave advice how to run an external
FastCGI server with daemontools, where this problem doesn't seem to
arise (besides other benefits):
http://catalyst.perl.org/calendar/2006/4




Thank you for the tip, however I'm already using "monit":http:// 
tildeslash.com/monit/ to do all my external fastcgi management.


Ruben

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] fastcgi, production catalyst and sigpipe

2007-12-27 Thread Bernhard Graf
Ruben Fonseca wrote:

> I can't believe it... no updates for like 6 years, and now I had the
> 0.17 version...
>
> Well red the Changelog, seems related to my problem. Installed the
> new version, rebooted the manager, and let's hope the bug don't hit
> me again :-)
>
> Thank you Jonathan!

The problem seemed to be related to the FastCGI's daemonize mode (-d):
http://catalyst.perl.org/calendar/2007/18 - Caveats

In last year's advent calender JR gave advice how to run an external 
FastCGI server with daemontools, where this problem doesn't seem to 
arise (besides other benefits):
http://catalyst.perl.org/calendar/2006/4
-- 
Bernhard Graf

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] fastcgi, production catalyst and sigpipe

2007-12-27 Thread Ruben Fonseca


On 2007/12/27, at 15:00, Jonathan Rockway wrote:



On Thu, 2007-12-27 at 14:56 +, Ruben Fonseca wrote:
Can you post me the mst's response please? Sorry for the  
inconvenience!




Searchable archive: http://www.mail-archive.com/ 
catalyst@lists.scsys.co.uk/



See that link?  Try clicking it.  Then you can find the post yourself.

Anyway, here it is:
http://www.mail-archive.com/catalyst@lists.scsys.co.uk/msg01041.html



I can't believe it... no updates for like 6 years, and now I had the  
0.17 version...


Well red the Changelog, seems related to my problem. Installed the  
new version, rebooted the manager, and let's hope the bug don't hit  
me again :-)


Thank you Jonathan!

Rúben
___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] fastcgi, production catalyst and sigpipe

2007-12-27 Thread Jonathan Rockway

On Thu, 2007-12-27 at 14:56 +, Ruben Fonseca wrote:
> Can you post me the mst's response please? Sorry for the inconvenience!

> 
> Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/


See that link?  Try clicking it.  Then you can find the post yourself.

Anyway, here it is:
http://www.mail-archive.com/catalyst@lists.scsys.co.uk/msg01041.html

Regards,
Jonathan Rockway



signature.asc
Description: This is a digitally signed message part
___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] fastcgi, production catalyst and sigpipe

2007-12-27 Thread Ruben Fonseca


On 2007/12/27, at 14:41, Chisel Wright wrote:


On Thu, Dec 27, 2007 at 10:24:41AM +, Ruben Fonseca wrote:


Hi! I have a Catalyst website in production, but started to hit some
problems lately. But first a little about my configuration:


Is this the extended version of the email you sent 4 days ago? It  
looks

very similar to me.

What results (if any) did you see after acting on mst's response?


Unfortunatly I had a problem with my email MTA and I didn't receive  
the MST response. That's why I signed to the mailling list with other  
email address and resent the (extended) email!


Can you post me the mst's response please? Sorry for the inconvenience!

Rúben
___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] fastcgi, production catalyst and sigpipe

2007-12-27 Thread Chisel Wright
On Thu, Dec 27, 2007 at 10:24:41AM +, Ruben Fonseca wrote:
>
> Hi! I have a Catalyst website in production, but started to hit some 
> problems lately. But first a little about my configuration:

Is this the extended version of the email you sent 4 days ago? It looks
very similar to me.

What results (if any) did you see after acting on mst's response?

Chisel
-- 
Chisel Wright
e: [EMAIL PROTECTED]
w: http://www.herlpacker.co.uk/

  We never decided to postpone this issue.
  We just agreed that we would deal with other issues first.

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] fastcgi, production catalyst and sigpipe

2007-12-27 Thread Jason Kohles

On Dec 27, 2007, at 5:24 AM, Ruben Fonseca wrote:



Hi! I have a Catalyst website in production, but started to hit some  
problems lately. But first a little about my configuration:


Catalyst website using the standard and the latest stable modules.
Linux + Apache 2 + fastcgi running in external mode.
fastcgi server (FCGIProcessManager) with 2 Catalyst children.

The problem is that, once a day, at random time, my application  
simply dies, and the only error I see on apache logs is:


FastCGI: server "/tmp/etrading-secure.fcgi" stderr : FastCGI: server  
(pid 8122): safe exit after SIGTERM, referer: https://__mysite__";


Digging on the situation, I put strace saving the system calls of  
both the fcgiprocessmanager (8120), and the 2 Catalyst children  
(8121, 8122) and found this:


- The first child (8121) receives a SIGPIPE and imediatly dies! Here  
are the last lines of strace before 8121 dies:


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

8121  18:17:20 --- SIGPIPE (Broken pipe) @ 0 (0) ---

I thing SIGPIPE is sent when the client closes the connection before  
all data is sent by Catalyst. But why does it terminate?


SIGPIPE means that the process was writing to a pipe and there was  
nothing listening on the other end of the pipe.  Look back through the  
trace and see what file descriptor 4 was assigned to and that might  
give you a clue what died.


- The process manager (8120) sees SIGPIPE and sends SIGTERM to the  
other child (8122). After the child dies, it turns itself down:


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 getppid()
(...)
8120  18:17:20 write(2, "FastCGI: manager (pid 8120): sen"..., 56) =  
56

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) ---
8120  18:17:21 write(2, "FastCGI: manager (pid 8120): ser"..., 68) =  
68
8120  18:17:21 write(2, "FastCGI: manager (pid 8120): dyi"..., 61) =  
61

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

What do you think is wrong here? I think that the catalyst  
application should not die when it receives a SIGPIPE. But it could  
be another problem. Please advice me. If you need more information  
about my environment, please ask!


What would you suggest it do if not die?  SIGPIPE means it is trying  
to talk to a process that is not listening, there isn't a great deal  
the application is going to be able to do about that in a portable  
manner...


--
Jason Kohles, RHCA RHCDS RHCE
[EMAIL PROTECTED] - http://www.jasonkohles.com/
"A witty saying proves nothing."  -- Voltaire



___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


[Catalyst] fastcgi, production catalyst and sigpipe

2007-12-27 Thread Ruben Fonseca


Hi! I have a Catalyst website in production, but started to hit some  
problems lately. But first a little about my configuration:


Catalyst website using the standard and the latest stable modules.
Linux + Apache 2 + fastcgi running in external mode.
fastcgi server (FCGIProcessManager) with 2 Catalyst children.

The problem is that, once a day, at random time, my application  
simply dies, and the only error I see on apache logs is:


FastCGI: server "/tmp/etrading-secure.fcgi" stderr : FastCGI: server  
(pid 8122): safe exit after SIGTERM, referer: https://__mysite__";


Digging on the situation, I put strace saving the system calls of  
both the fcgiprocessmanager (8120), and the 2 Catalyst children  
(8121, 8122) and found this:


- The first child (8121) receives a SIGPIPE and imediatly dies! Here  
are the last lines of strace before 8121 dies:


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

8121  18:17:20 --- SIGPIPE (Broken pipe) @ 0 (0) ---

I thing SIGPIPE is sent when the client closes the connection before  
all data is sent by Catalyst. But why does it terminate?


- The process manager (8120) sees SIGPIPE and sends SIGTERM to the  
other child (8122). After the child dies, it turns itself down:


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 getppid()
(...)
8120  18:17:20 write(2, "FastCGI: manager (pid 8120): sen"..., 56) = 56
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) ---
8120  18:17:21 write(2, "FastCGI: manager (pid 8120): ser"..., 68) = 68
8120  18:17:21 write(2, "FastCGI: manager (pid 8120): dyi"..., 61) = 61
(...)
8120  18:17:21 exit_group(0)= ?

What do you think is wrong here? I think that the catalyst  
application should not die when it receives a SIGPIPE. But it could  
be another problem. Please advice me. If you need more information  
about my environment, please ask!


Cheers,
Rúben
___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/