Stas Bekman wrote:[...]
I suppose that since $apr->param is an XSUB perl decides that it's unsafe to interrupt it. Or may be it's an OS issue, so perl doesn't even get a chance to intervene.
Have you tried strace(1)ing httpd and seeing where does it hang? Of course start the server with -X so you have only one pid to track.
The output of strace is too long, here are some of the last lines:
alarm(300) = 0 read(3, "------------SFQ0oV5N2ysZosOirvfy"..., 4096) = 664 alarm(0) = 300 alarm(300) = 0 read(3, 0x8293b7c, 4096) = ? ERESTARTSYS (To be restarted) --- SIGWINCH (Window changed) @ 0 (0) --- read(3, 0x8293b7c, 4096) = ? ERESTARTSYS (To be restarted) --- SIGWINCH (Window changed) @ 0 (0) --- read(3, 0x8293b7c, 4096) = ? ERESTARTSYS (To be restarted) --- SIGWINCH (Window changed) @ 0 (0) --- read(3,
it hanged here. Seems after 300 seconds, it continued and died:
0x8293b7c, 4096) = ? ERESTARTSYS (To be restarted) --- SIGALRM (Alarm clock) @ 0 (0) --- +++ killed by SIGALRM +++
Is it related to the reading request from the client ?
I'm not sure what SIGWINCH is, was it a concole switching event?
Will front-end server solve the problem ?
alarm(300) is an Apache alarm. Can you see the perl's alarm calls earlier in the trace? since you tried alarm 1, grep for alarm(1).
I think what happens is that perl sets the alarm, but then Apache resets it again to its own value and its own sighandler. Even though it may restore the perl sighandle at the end it's happening too late.
So i'd try:
1)
You could try to lower Apache's IO timeout for this call. I can't see it documented (defined in Server.xs) but you can read/write server timeout values:
my $timeout_secs = 1; my $orig_timeout = $r->server->timeout($timeout_secs); $apr->param; # no perl alarm is now needed $r->server->timeout($orig_timeout_secs);
2) I'm not sure this will work, since read will probably set the alarm after kill_timeout, so it won't accomplish that affect.
$r->kill_timeout; ... alarm eval here with $apr->param call ... $r->reset_timeout; http://perl.apache.org/docs/1.0/api/Apache.html#_r_E_gt_reset_timeout
3) Try Sys::Signal to set the perl alarm. I don't think though it'll give you the solution, since it was written to have the C level sighandlers restored after perl's sighandler was called. And recent Apache versions are supposed to work well with plain perl sighandlers.
__________________________________________________________________ Stas Bekman JAm_pH ------> Just Another mod_perl Hacker http://stason.org/ mod_perl Guide ---> http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
-- Reporting bugs: http://perl.apache.org/bugs/ Mail list info: http://perl.apache.org/maillist/modperl.html