-
Notifications
You must be signed in to change notification settings - Fork 179
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1de83c9
commit ab61b89
Showing
1 changed file
with
11 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,20 @@ | ||
Note: this patch was manually edited to remove two changes to the | ||
SubprocessWatcherMixin.tearDown() method found in | ||
Lib/test/test_asyncio/test_subprocess.py; the first change moved the | ||
super() call to the end of that function, while the second reverted | ||
the first change, resulting in no net change to the file. | ||
Fix for https://github.com/python/cpython/issues/82504 | ||
|
||
The function being patched was changed between Python 3.9 and 3.12 | ||
such that the first patch failed to apply. | ||
This patches MultiLoopChildWatcher, which was deprecated in Python | ||
3.12 and is scheduled for removal in Python 3.14. The patch was not | ||
accepted upstream but it seems to have worked for us and has been in | ||
our Python 3.9 without complaints. | ||
|
||
Deprecation PR: https://github.com/python/cpython/pull/98089 | ||
|
||
The patch is originally from: | ||
|
||
From 5d1013256c133b61587b6a80a0f9d509ac11d123 Mon Sep 17 00:00:00 2001 | ||
From: Chris Jerdonek <[email protected]> | ||
Date: Sat, 16 May 2020 15:57:27 -0700 | ||
Subject: [PATCH 1/5] bpo-38323: Fix rare MultiLoopChildWatcher hangs. | ||
|
||
This changes asyncio.MultiLoopChildWatcher's attach_loop() method | ||
to call loop.add_signal_handler() instead of calling only | ||
signal.signal(). This should eliminate some rare hangs since | ||
loop.add_signal_handler() calls signal.set_wakeup_fd(). Without | ||
this, the main thread sometimes wasn't getting awakened if a | ||
signal occurred during an await. | ||
--- | ||
Doc/library/asyncio-eventloop.rst | 4 ++- | ||
Doc/library/asyncio-policy.rst | 13 ++++++- | ||
Lib/asyncio/unix_events.py | 34 ++++++++++++++----- | ||
Lib/test/test_asyncio/test_subprocess.py | 3 +- | ||
.../2020-05-16-17-50-10.bpo-38323.Ar35np.rst | 2 ++ | ||
5 files changed, 44 insertions(+), 12 deletions(-) | ||
create mode 100644 Misc/NEWS.d/next/Library/2020-05-16-17-50-10.bpo-38323.Ar35np.rst | ||
|
||
--- Python-3.12.1/Lib/asyncio/unix_events.py.orig | ||
+++ Python-3.12.1/Lib/asyncio/unix_events.py | ||
--- Python-3.12.2/Lib/asyncio/unix_events.py.orig | ||
+++ Python-3.12.2/Lib/asyncio/unix_events.py | ||
@@ -88,6 +88,8 @@ | ||
def add_signal_handler(self, sig, callback, *args): | ||
"""Add a handler for a signal. UNIX only. | ||
|