On Fri, 25 May 2001, Matthew Darwin wrote:

>
> I've been following the documentation at
> 
>http://www.perldoc.com/cpan/Apache/Example.html#Handling%20the%20'User%20pressed%20Stop%20button'%20case
>
> I've written a test perl module that implements the code to handle the
> case when the user presses 'stop'. When I do
>       GET http://localhost:81/nm/xxx
> then press ^C, everything works as expected.  However, when I do
>       GET http://localhost:80/nm/xxx
> which involves going through a second apache server
> (http://perl.apache.org/tuning/#USING_ProxyPass_WITH_TWO_SERVERS),
> pressing ^C never terminates the web request.  Is the first Apache not
> closing the socket for the second Apache?
>
> Has anybody run into this before? I'm using Linux 2.2 with
> Apache/1.3.19 (Unix) mod_perl/1.25
>
> Configuration details available upon request.

You right. It seems that mod_proxy won't abort on SIGPIPE.

1. mod_proxy won't notice any problem since it buffers your output from
mod_perl, until the buffer is full or the connection is closed.

2. if you change "\0" with "\0" x 2**14 (16k), it detects it immediately
but doesn't abort the connection and keeps on reading the output from
mod_perl server. Observe the output of strace:

alarm(300)                              = 300
read(4, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 8192)
= 8192
alarm(300)                              = 300
write(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"...,
8192) = -1 EPIPE (Broken pipe)
--- SIGPIPE (Broken pipe) ---
alarm(300)                              = 300
read(4, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 8192)
= 8192
alarm(300)                              = 299

so mod_perl never learns that the connection was aborted. Apache doesn't
catch SIGPIPE and mod_proxy doesn't do anything by itself.



_____________________________________________________________________
Stas Bekman              JAm_pH     --   Just Another mod_perl Hacker
http://stason.org/       mod_perl Guide  http://perl.apache.org/guide
mailto:[EMAIL PROTECTED]   http://apachetoday.com http://eXtropia.com/
http://singlesheaven.com http://perl.apache.org http://perlmonth.com/


Reply via email to