From: Tim W. <tim...@gm...> - 2005-01-20 06:04:50
|
All, I'd like to have your input on the following problem: whenever things go wrong in perfparsed (usually a problem with the database), the application will exit immediately. In the case of perfparsed using the pipe method as input, this has a very nasty side-effect on Nagios: every process sending data to the pipe never ends, and Nagios's check latency times start to skyrocket. This behaviour is not seen when you manually kill perfparsed. In an attempt to figure out why the 'kill' does not induce the same effect on Nagios, I concluded that the reason is that kill sends a SIGTERM to perfparsed, which is nicely handled in log_reader.c. The sighandler _closes all log sources_. A simple exit somewehere in the application does not, and subsequent write attempts to the pipe are hanging (blocked). Question 1: is my conclusion correct? Question 2: if so, is there any way you can catch an exit call with a signal handler? Or should you use something like raise(SIGxxx) instead of exit? (Q3: has anyone else experienced this problem?) Regards, Tim |