Want to monitor process..

Stephen shriek at gmx.co.uk
Fri Mar 1 04:02:08 EST 2002


> > Unfortunately, my own applications seem to crash as opposed to
> > shutdown normally, so it's probably not going to help me. From the
> > library reference ~
> > "Note: the functions registered via this module are not called when
> > the program is killed by a signal, when a Python fatal internal error
> > is detected, or when os._exit() is called. "
> 
> Yikes!  "Crash"?  Do you really mean they crash the Python interpreter,
> or do you mean they exit with an exception?

Sorry, I guess I mean "exit with an exception" though to be honest, I
still don't know because I haven't been able to run the programs
interactively during a 'crash'.  The problem seems to be that
sometimes a thread can take up to 60 seconds to be dealt with (not by
design but because one of the backend systems takes so long to
respond) and in the meantime requests keep coming in ~ during peak
load (5 requests/sec), this can result in a high number of threads
kept open.


> If the former, you've got seriously problems, I agree.
> 
> If the latter, just wrap the highest level code with a try/finally
> or try/except and put code in to ensure the child processes are
> properly terminated.  Simple, clean, safe.

Will do.  I didn't want to put try/except/finally at the highest level
of code yet since we're actually in Beta and I want to know when my
server encounters a problem.  Problem has been that not running it in
interactive mode, I've missed the reasons for the failures.  That's
why I also asked about logging recently.
 

> My Python programs *never* crash (as in kill the interpreter)
> but maybe that's just me... I doubt it.

I doubt it too. More likely my error handling isn't sufficient.

Stephen.



More information about the Python-list mailing list