[Supervisor-users] fcgi program section prevents supervisord from restarting
Roger Hoover
roger.hoover at gmail.com
Mon Aug 17 01:26:08 EDT 2009
Thanks, Mike. I have a patch (see attached) that addresses the following
issues:
1) Reloading the config for an fcgi process group did not close the fcgi
socket - although the fcgi socket is a shared resource at the fcgi process
group level, it can no longer be managed in the FastCGIProcessGroup class
because that class has no way to get an event when all it's processes have
been reaped (which is when the socket needs to be closed). So, I had to
implement a reference counting scheme and override the Subprocess.spawn()
and Subprocess.finish() methods.
2) Rereading the config did not pick up changes to the socket parameter in a
fcgi-program section - this was a simple fix requiring a little
customization of the __eq__() method
I wrote unit tests for the new code and also tested the reread/reload
functionality with an integration test. Let me know if you find any issues.
Roger
On Sun, Aug 16, 2009 at 1:02 PM, Mike Naberezny <mike at maintainable.com>wrote:
> Hi Roger,
>
> Roger Hoover wrote:
>
>> Chris or Mike, after briefly looking over the code, it looks like the
>> place to do this is to override the finish() method like this.
>>
>> class FastCGISubprocess(Subprocess):
>>
>> def finish(self, pid, sts):
>> #do FCGI Socket clean up here
>> ...
>> #do parent finish()
>> Subprocess.finish(self, pid, sts)
>>
>> Does this seem like the right approach?
>>
>
> This looks good to me.
>
> Thanks,
> Mike
>
> --
> Mike Naberezny
> Maintainable Software
> http://maintainable.com
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.supervisord.org/pipermail/supervisor-users/attachments/20090816/4691cabe/attachment-0001.htm
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fcgi_reload.patch
Type: application/octet-stream
Size: 21747 bytes
Desc: not available
Url : http://lists.supervisord.org/pipermail/supervisor-users/attachments/20090816/4691cabe/attachment-0001.obj
More information about the Supervisor-users
mailing list