From e6eabd43458c041ceae418c3806dcfcc30b5ed2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Charles-Fran=C3=A7ois=20Natali?= Date: Sat, 19 Nov 2011 09:59:43 +0100 Subject: [PATCH] Issue #13215: multiprocessing.Connection: don't hammer the remote end with retries in case of ECONNREFUSED. --- Lib/multiprocessing/connection.py | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/Lib/multiprocessing/connection.py b/Lib/multiprocessing/connection.py index 0c9695830ea..c6c61138341 100644 --- a/Lib/multiprocessing/connection.py +++ b/Lib/multiprocessing/connection.py @@ -608,21 +608,7 @@ def SocketClient(address): ''' family = address_type(address) with socket.socket( getattr(socket, family) ) as s: - t = _init_timeout() - - while 1: - try: - s.connect(address) - except socket.error as e: - if e.args[0] != errno.ECONNREFUSED or _check_timeout(t): - debug('failed to connect to address %s', address) - raise - time.sleep(0.01) - else: - break - else: - raise - + s.connect(address) fd = duplicate(s.fileno()) conn = Connection(fd) return conn