On Sun, Nov 20, 2011 at 3:18 AM, Graham Dumpleton
<[email protected]> wrote:
> I have lost Internet at home at moment so hard to reply in depth.
Please, reply when you can. Thanks a lot for your quick reply anyways :)
>
> Go to mod_wsgi docs and look for debugging tips page. Go to very last
> section. Implement that mechanism for being able to dump out python stack
> traces for process on demand.
Ohh, forgot to tell that I read the debugging tips too. We considered
doing this, but we wanted to try with the options I mentioned first,
just in case. Also, mod_wsgi is not planned to dump a trace of the
application when it find blocked-requests ? If that is the case, I
really prefer to update to a newer mod_wsgi :)
Also, it would be great if getting the trace could be automated
somehow, because it tends to happen at 4:00 am, so if it could get the
trace and then restart it automatically would be great. If I
instrument the python application code to wait for the file to dump
stack traces, is there any parameter on WSGI I can use to run some
script (that creates that file, for example) before it restarts the
process because of the inactivity timer ?
Looking through the WSGI code I see:
if (inactivity_time <= now) {
ap_log_error(APLOG_MARK, WSGI_LOG_INFO(0), wsgi_server,
"mod_wsgi (pid=%d): Daemon process "
"inactivity timer expired, stopping "
"process '%s'.", getpid(),
daemon->group->name);
restart = 1;
Calling system() here or in the "if (restart)" bellow this is
acceptable (in wsgi_monitor_thread()) ? (I don't know in which context
is this run, and if apache modules have some restrictions). If it is,
perhaps it could be added a parameter to run a script before the
process is restarted ? And perhaps the program would have to "guess"
how much it will take to dump the trace, so the system() call does not
return before the python app have dumped all stack traces. Although
there must be a better way if we thnik about it more than 1 minute :-)
Also, we are using django too. Perhaps there is a simpler way using
some django stuff to instrument our code to dump stack traces ?
>
> Likely your code is dead locking at some point.
Yeah, we were afraid of that :)
But we don't have any idea where. Perhaps waiting for the DB, perhaps
for disk, perhaps when internet has a mini-downtime, or perhaps it is
just a bug... :S
>
> More later when able to.
Yes, when you can please. Take your time :)
Thanks a lot,
Rodrigo
--
You received this message because you are subscribed to the Google Groups
"modwsgi" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/modwsgi?hl=en.