clintonm9 has asked for the wisdom of the Perl Monks concerning the following question:
So the problem that I am having is if the user stops the connection the process is still running. The process won’t stop until the SQL statement is completed. The bigger program is when all the tables are locked these process start growing until there are too many for the server to handle. So my question is, is there a way to stop these scripts if the user disconnects. I would think apache would see the socket is broken and could kill the Perl script. Or is there a better method to use to accomplish the same thing? Thanks in advance!my $pid; $SIG{CHLD} = 'IGNORE'; unless($pid = fork) { while(1) { sleep 90; warn "Output taking longer then 90 seconds, waiting"; } exit; } ….. Do DBI stuff kill(9,$pid);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Perl and Apache… Process keeps running.
by Anonymous Monk on Jan 14, 2010 at 04:31 UTC | |
by clintonm9 (Sexton) on Jan 14, 2010 at 05:11 UTC | |
by Anonymous Monk on Jan 14, 2010 at 05:33 UTC | |
|
Re: Perl and Apache… Process keeps running.
by scorpio17 (Canon) on Jan 14, 2010 at 14:32 UTC |