On Wed, Jun 03, 2009 at 01:43:37PM +0200, Sylvain Rochet wrote:
> This can't be a bug of suphp. At best a bug of Apache, and I am sure 
> it is not. Killing a process might have dangerous endings, like half 
> finished jobs. Is it better to finish something while the client's 
> connection is closed without sending the result or to kill something 
> which is not finished yet ?  I guess it's better to let the script 
> finish ;-)

Yes, this involves Apache alright, but I have no idea if the capability
is there builtin into apache or it's lacking such a mechanism:
communicate back to suPHP that the client has disconnected. I started
the discussion on suPHP's list because it happens from suPHP; with the
hope expert users or developers can explain either it is a bug or
not(perhaps a feature). So can anyone confirm?

My view on CGI scripts is different. And I hope you understand why this
is the case: CGI scripts should never run infinitely. The question is,
how can you justify this? Answer: you can't. 
But when and why should the script/program be terminated? We are talking
about CGI's here, so they are meant to be executed by the webserver
service; its output is returned to the client. In the event a client
disconnects, this is similar to a user killing a normal process (for
instance ``killall top''). But this might be little harsh on
webdevelopers(I used to be one) as they expect their program to run
uninterrupted(don't confuse with system interrupts). So now, the only
way we can forcefully terminate any CGI process is by the means of a
timeout. Just like PHP. But this should be a feature in suPHP. Perhaps
defining the timeout in suphp.conf?

You guess it's better to let the script finish. What if this script
never finishes? Because there's no time constraint, a (buggy) script
could run forever. By no means this program/script should be used as a
CGI. In case of streaming data, that could be an exception, but there
are better alternatives than use a CGI to stream.

> Personally I use a tiny home-made software to kill processes in this 
> situation.
That's a hack. It could go wrong very badly. I don't want this in a
production environment.

> Hope I helped ;)
Yes you did 

Cheers,

-- 
--
Xiwen Cheng
System Administrator            ;" Enthusiasm is contagious,
Mathematical Institute          ;  but hype is a disease. "
Leiden University               ;E-mail: xch...@math.leidenuniv.nl
Niels Bohrweg 1 K210            ;Office: (+31) 715277134
2333 CA Leiden                  ;Mobile: (+31) 611119991
The Netherlands                 ;GPG Key id: 194F572B
++

Attachment: pgp2Bgn89urFH.pgp
Description: PGP signature

_______________________________________________
suPHP mailing list
suPHP@lists.marsching.biz
http://lists.marsching.com/mailman/listinfo/suphp

Reply via email to