[issue5177] multiprocessing: SocketListener should use SO_REUSEADDR
Jon Dee
report at bugs.python.org
Sat Feb 7 15:13:04 CET 2009
New submission from Jon Dee <j.a.t.dee at gmail.com>:
Without this flag it is necessary to wait for e.g. 120s after closing
down a 'BaseManager' server before restarting, due to the socket being
in the TIME_WAIT state.
Example error, which occurs if a server is started, data transmitted
down the socket, the server shut down, then restarted:
File "/usr/local/lib/python2.6/multiprocessing/connection.py", line
220, in __init__
self._socket.bind(address)
File "<string>", line 1, in bind
error: [Errno 48] Address already in use
I added (locally):
self._socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
to SocketListener.__init__, and it resolves the issue.
----------
components: Library (Lib)
messages: 81336
nosy: jon_dee
severity: normal
status: open
title: multiprocessing: SocketListener should use SO_REUSEADDR
type: behavior
versions: Python 2.6
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue5177>
_______________________________________
More information about the Python-bugs-list
mailing list