whoops -- I messed up the formatting of my patch -- here's another try.. -- David
On Sun, 29 Mar 2009 00:10 -0700, "David Creemer" <[email protected]> wrote: > In April, 2008 there was a brief thread on this list with the same > subject as this message (see > http://lists.supervisord.org/pipermail/supervisor-users/2008-April/000216.html) > > The basic problem is that stopping a process through supervisorctl > sometimes fails to log the last bit of output from a process. This is > especially the case if you put something like a print of "shutting down" > in the SIGTERM handler of your sub-process. This is exactly what I did, > and so I had this same issue. I traced the problem to the deceptively > simple "drain()" method in process.py. Drain is called just before the > process is killed, but if there is no output pending from the > subprocess, the call to read data is misinterpreted as an EOF, and the > pipes are closed. It seems that the a dispatcher should only be read > from if there is actual data waiting. > > Enclosed is a rough patch (against top of trunk) to make drain work like > the main select() loop (in fact the code is liberally lifted from the > main select loop...). It seems to work for me. > > Thanks, > -- David
drain-r838.v2.patch
Description: Binary data
_______________________________________________ Supervisor-users mailing list [email protected] http://lists.supervisord.org/mailman/listinfo/supervisor-users
