From bb02d15fe9128b4f821c35fbc9f5d1d0b712a2f5 Mon Sep 17 00:00:00 2001 From: Tim Stumbaugh Date: Wed, 12 Jan 2022 14:29:07 -0700 Subject: [PATCH] Add news and comment --- newsfragments/2209.bugfix.rst | 3 +++ trio/tests/test_subprocess.py | 2 ++ 2 files changed, 5 insertions(+) create mode 100644 newsfragments/2209.bugfix.rst diff --git a/newsfragments/2209.bugfix.rst b/newsfragments/2209.bugfix.rst new file mode 100644 index 0000000000..8ea6094f15 --- /dev/null +++ b/newsfragments/2209.bugfix.rst @@ -0,0 +1,3 @@ +Fix a bug that could cause `Process.wait` to hang on Linux systems using pidfds, if +another task were to access `Process.returncode` after the process exited but before +``wait`` woke up diff --git a/trio/tests/test_subprocess.py b/trio/tests/test_subprocess.py index c2e17cf0da..2627521380 100644 --- a/trio/tests/test_subprocess.py +++ b/trio/tests/test_subprocess.py @@ -572,6 +572,8 @@ async def test_for_leaking_fds(): assert set(SyncPath("/dev/fd").iterdir()) == starting_fds +# regression test for #2209 +@pytest.mark.skipif(not posix, reason="Regression test for Linux-only bug") async def test_subprocess_pidfd_unnotified(): noticed_exit = None