httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marc Slemko <ma...@worldgate.com>
Subject Re: Spinning httpds - One Solution
Date Fri, 21 Aug 1998 04:24:44 GMT
On Fri, 21 Aug 1998, Rasmus Lerdorf wrote:

> > If a hard_timeout is in scope it longjmps back to the main loop and aborts
> > everything.  How is your code even getting invoked?
> > 
> > Not that setting aborted is a bad thing, I'd rather we figure out what's
> > really going on before we make that change though. 
> 
> Hrm..  Perhaps I have been doing it wrong all along then, but mod_php3.c
> has:
> 
>     hard_timeout("send", r);
> 
>     php3_save_umask();
>     chdir_file(r->filename);
>     add_common_vars(r);
>     add_cgi_vars(r);
>     apache_php3_module_main(r, fd, display_source_mode, preprocessed);
> 
>     /* Done, restore umask, turn off timeout, close file and return */
>     php3_restore_umask();
>     kill_timeout(r);

Erm... so how does that work if php3_restore_umask isn't called after a
hard timeout?

What do you think is "wrong" about your code?  

hard timeout --> gets the hell out when a timeout or SIGPIPE happens
soft timeout --> set r->connection->aborted when ...

I'm guessing what is happening for mod_perl is that the connection is
going bad for some other reason.  So my guess would be that timeout() is
never being called.  The workaround is to deal with the return code from
rwrite() and not just keep trying it over and over.  The reason why the
connection is getting invalidated... is a different issue.

Hmm.  Don't you set a SIGPIPE handler in mod_php in the above sequence? 

> 
> apache_php3_module_main() is the entry point into PHP's parser, so a hard
> timeout is in scope for the duration of the execution of a PHP script.
> 
> -Rasmus
> 


Mime
View raw message