diff --git a/lib/core/option.py b/lib/core/option.py index 28ea9c4cb..b666c79a6 100644 --- a/lib/core/option.py +++ b/lib/core/option.py @@ -1031,7 +1031,8 @@ def _setSocketPreConnect(): if len(socket._ready[address]) < SOCKET_PRE_CONNECT_QUEUE_SIZE: s = socket.socket() s._connect(address) - socket._ready[address].append(s._sock) + with kb.locks.socket: + socket._ready[address].append(s._sock) except socket.error: pass finally: