This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author mark.dickinson
Recipients benjamin.peterson, donmez, jnoller, mark.dickinson
Date 2008-08-06.20:54:11
SpamBayes Score 8.942322e-09
Marked as misclassified No
Message-id <1218056053.33.0.655069269057.issue3419@psf.upfronthosting.co.za>
In-reply-to
Content
> I believe the conn refused error is another race, the child processes  
> are connecting to a manager which is shutting down/gone

After some research, I think it actually has to do with the value of the 
'backlog' parameter when creating a Listener instance: if there are too 
many queued requests to a socket then further connection requests are 
refused;  the 'backlog' parameter appears to set the maximum size of the 
queue.

...or something like that.  I'm a novice here... :-)

Anyway, in the __init__ method of the Server class, in managers.py, the 
Server creates a Listener instance with the line

        self.listener = Listener(address=address, backlog=5)

When I change backlog to 50 instead of 5, I don't see the connection 
refused error any more.

I'm not suggesting that the backlog value should be changed---it 
probably shouldn't.  But this does at least explain why connections can 
be refused, and why they should be retried in that case.

I do still think that the patch, or something like it, should be 
applied.
History
Date User Action Args
2008-08-06 20:54:13mark.dickinsonsetrecipients: + mark.dickinson, donmez, benjamin.peterson, jnoller
2008-08-06 20:54:13mark.dickinsonsetmessageid: <1218056053.33.0.655069269057.issue3419@psf.upfronthosting.co.za>
2008-08-06 20:54:12mark.dickinsonlinkissue3419 messages
2008-08-06 20:54:11mark.dickinsoncreate