[New-bugs-announce] [issue13215] multiprocessing Manager.connect() aggressively retries refused connections

Benjamin Gilbert report at bugs.python.org
Tue Oct 18 21:16:57 CEST 2011

New submission from Benjamin Gilbert <bgilbert at 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 <report at bugs.python.org>

More information about the New-bugs-announce mailing list