[prev in list] [next in list] [prev in thread] [next in thread] 

List:       apache-modperl
Subject:    Closing a misbehaving socket
From:       Mark Horstmeier <meh () imall ! com>
Date:       1998-11-25 22:37:34
[Download RAW message or body]

I have a program, modperl 1.16/stronghold 2.3, that places a socket call
to our database.  the db is supposed to return info (suprised?) and
terminate the socket, but at times does not behave in polite fashion and
may leave the socket open and my poor program waiting for a reply.

Since this is not *supposed* to happen, I have let the http request time
out and kill the execution.  Of late, we have noticed that requests are
starting to queue up and zombie.  We suspect that these are hapless
requests for data that are never going to be answered.

Could this be because people are hitting the back button and not
allowing the process to terminate (however ungracefully)?

If so (and perhaps regardlessly), since I have no control over the
database end, I am looking for a mostly graceful way of trapping this
error state.

My admin suggested starting a sigAlarm, trapping the sig and forcing an
exit, but I am not sure what the implications of this course would be in
a modperl environment.

I must confess that I don't understand how the REAPER function in the
camel socket example works, or if it applies (sig{CHLD}?)
--
Mark Horstmeier               Every normal man must be tempted at
Senior System Programmer      times to spit on his hands, hoist the 
iMALL Inc.                    black flag, and begin slitting throats.
ECS Group                        -H.L. Mencken

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic