Increase the backlog for multiprocessing.connection.Listener` objects created
by `multiprocessing.manager` and `multiprocessing.resource_sharer` to
significantly reduce the risk of getting a connection refused error when creating
a `multiprocessing.connection.Connection` to them.
Listener, Client = listener_client[serializer]
# do authentication later
- self.listener = Listener(address=address, backlog=16)
+ self.listener = Listener(address=address, backlog=128)
self.address = self.listener.address
self.id_to_obj = {'0': (None, ())}
from .connection import Listener
assert self._listener is None, "Already have Listener"
util.debug('starting listener and thread for sending handles')
- self._listener = Listener(authkey=process.current_process().authkey)
+ self._listener = Listener(authkey=process.current_process().authkey, backlog=128)
self._address = self._listener.address
t = threading.Thread(target=self._serve)
t.daemon = True
--- /dev/null
+Increase the backlog for :class:`multiprocessing.connection.Listener` objects created
+by :mod:`multiprocessing.manager` and :mod:`multiprocessing.resource_sharer` to
+significantly reduce the risk of getting a connection refused error when creating
+a :class:`multiprocessing.connection.Connection` to them.