Kaydet (Commit) c8ef9bc6 authored tarafından Richard Oudkerk's avatar Richard Oudkerk

Issue #18455: multiprocessing should not retry connect() with same socket.

üst a85fa5c6
...@@ -294,15 +294,16 @@ def SocketClient(address): ...@@ -294,15 +294,16 @@ def SocketClient(address):
''' '''
Return a connection object connected to the socket given by `address` Return a connection object connected to the socket given by `address`
''' '''
family = address_type(address) family = getattr(socket, address_type(address))
s = socket.socket( getattr(socket, family) )
s.setblocking(True)
t = _init_timeout() t = _init_timeout()
while 1: while 1:
s = socket.socket(family)
s.setblocking(True)
try: try:
s.connect(address) s.connect(address)
except socket.error, e: except socket.error, e:
s.close()
if e.args[0] != errno.ECONNREFUSED or _check_timeout(t): if e.args[0] != errno.ECONNREFUSED or _check_timeout(t):
debug('failed to connect to address %s', address) debug('failed to connect to address %s', address)
raise raise
......
...@@ -26,6 +26,8 @@ Core and Builtins ...@@ -26,6 +26,8 @@ Core and Builtins
Library Library
------- -------
- Issue #18455: multiprocessing should not retry connect() with same socket.
- Issue #18101: Tcl.split() now process Unicode strings nested in a tuple as it - Issue #18101: Tcl.split() now process Unicode strings nested in a tuple as it
do with byte strings. do with byte strings.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment