New submission from Benjamin Gilbert <bgilb...@backtick.net>:

multiprocessing.managers.BaseManager.connect() takes 20 seconds to return on 
failure, even if the server refuses the connection.  This is because the 
function that creates the connection, 
multiprocessing.connection.SocketClient(), handles ECONNREFUSED by retrying the 
connection attempt every 10 ms for 20 seconds.

While a 20 second timeout may make sense for *unresponsive* servers, 
ECONNREFUSED probably indicates that the server is not listening on this port, 
so hammering it with 1,999 more connection attempts isn't going to help.  In 
this case, SocketClient() should fail immediately, or -- at most -- retry a 
small number of times with exponential backoff.

----------
components: Library (Lib)
messages: 145857
nosy: bgilbert
priority: normal
severity: normal
status: open
title: multiprocessing Manager.connect() aggressively retries refused 
connections
type: behavior
versions: Python 2.7, Python 3.2

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue13215>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to