Skip to content

Commit

Permalink
simplify comment for 35-20142.patch
Browse files Browse the repository at this point in the history
  • Loading branch information
mtelka authored and Bill-Sommerfeld committed Feb 9, 2024
1 parent 1de83c9 commit ab61b89
Showing 1 changed file with 11 additions and 25 deletions.
36 changes: 11 additions & 25 deletions components/python/python-312/patches/35-20142.patch
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 <chris.jerdonek@gmail.com>
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.
Expand Down

0 comments on commit ab61b89

Please sign in to comment.