Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c5d28a0

Browse files
committed
Merge 70717 to 30maint
1 parent 6ae7a7d commit c5d28a0

3 files changed

Lines changed: 55 additions & 0 deletions

File tree

Lib/multiprocessing/connection.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,7 @@ class SocketListener(object):
214214
'''
215215
def __init__(self, address, family, backlog=1):
216216
self._socket = socket.socket(getattr(socket, family))
217+
self._socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
217218
self._socket.bind(address)
218219
self._socket.listen(backlog)
219220
self._address = self._socket.getsockname()

Lib/test/test_multiprocessing.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1190,6 +1190,30 @@ def test_remote(self):
11901190
del queue
11911191
manager.shutdown()
11921192

1193+
class _TestManagerRestart(BaseTestCase):
1194+
1195+
def _putter(self, address, authkey):
1196+
manager = QueueManager(
1197+
address=address, authkey=authkey, serializer=SERIALIZER)
1198+
manager.connect()
1199+
queue = manager.get_queue()
1200+
queue.put('hello world')
1201+
1202+
def test_rapid_restart(self):
1203+
authkey = os.urandom(32)
1204+
manager = QueueManager(
1205+
address=('localhost', 9999), authkey=authkey, serializer=SERIALIZER)
1206+
manager.start()
1207+
1208+
p = self.Process(target=self._putter, args=(manager.address, authkey))
1209+
p.start()
1210+
queue = manager.get_queue()
1211+
self.assertEqual(queue.get(), 'hello world')
1212+
manager.shutdown()
1213+
manager = QueueManager(
1214+
address=('localhost', 9999), authkey=authkey, serializer=SERIALIZER)
1215+
manager.start()
1216+
11931217
#
11941218
#
11951219
#

Misc/NEWS

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,36 @@ Core and Builtins
255255
Library
256256
-------
257257

258+
- Issue #5177: Multiprocessing's SocketListener class now uses
259+
socket.SO_REUSEADDR on all connections so that the user no longer needs
260+
to wait 120 seconds for the socket to expire.
261+
262+
- Adjusted _tkinter to compile without warnings when WITH_THREAD is not
263+
defined (part of issue #5035).
264+
265+
- Issue #5561: Removed the sys.version_info shortcuts from platform's
266+
python_version() and python_version_tuple() since they produced different
267+
output compared to previous Python versions.
268+
269+
- Issue #1034053: unittest now supports skipping tests and expected failures.
270+
271+
- Issue #5068: Fixed the tarfile._BZ2Proxy.read() method that would loop
272+
forever on incomplete input. That caused tarfile.open() to hang when used
273+
with mode 'r' or 'r:bz2' and a fileobj argument that contained no data or
274+
partial bzip2 compressed data.
275+
276+
- Issue #5536: urllib.urlretrieve makes sure to close the file it's writing to
277+
even if an exception occurs.
278+
279+
- Issue #5381: Added object_pairs_hook to the json module. This allows
280+
OrderedDicts to be built by the decoder.
281+
282+
- Issue #2110: Add support for thousands separator and 'n' type
283+
specifier to Decimal.__format__
284+
285+
- Fix Decimal.__format__ bug that swapped the meanings of the '<' and
286+
'>' alignment characters.
287+
258288
- Issue #1222: locale.format() bug when the thousands separator is a space
259289
character.
260290

0 commit comments

Comments
 (0)