From 6eebcb9fb5ae9fa5fe3bd768579983e81fefdf3d Mon Sep 17 00:00:00 2001 From: Kumar Aditya Date: Sun, 16 Mar 2025 11:40:21 +0000 Subject: [PATCH 1/3] remove multiprocessing suppressions --- Tools/tsan/suppressions_free_threading.txt | 2 -- 1 file changed, 2 deletions(-) diff --git a/Tools/tsan/suppressions_free_threading.txt b/Tools/tsan/suppressions_free_threading.txt index fd47c85af1adb1..b0d64d36996920 100644 --- a/Tools/tsan/suppressions_free_threading.txt +++ b/Tools/tsan/suppressions_free_threading.txt @@ -13,11 +13,9 @@ # These warnings trigger directly in a CPython function. race_top:assign_version_tag -race_top:_multiprocessing_SemLock_acquire_impl race_top:_Py_slot_tp_getattr_hook race_top:dump_traceback race_top:fatal_error -race_top:_multiprocessing_SemLock_release_impl race_top:_PyFrame_GetCode race_top:_PyFrame_Initialize race_top:_PyObject_TryGetInstanceAttribute From 656f8fbba70a1571788d34ec61ac2293213c80ae Mon Sep 17 00:00:00 2001 From: Kumar Aditya Date: Mon, 17 Mar 2025 18:46:59 +0000 Subject: [PATCH 2/3] fix drain --- Lib/asyncio/base_events.py | 2 +- Tools/tsan/suppressions_free_threading.txt | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Lib/asyncio/base_events.py b/Lib/asyncio/base_events.py index 546361f80b1f47..ff63639638c13f 100644 --- a/Lib/asyncio/base_events.py +++ b/Lib/asyncio/base_events.py @@ -1295,8 +1295,8 @@ async def _sendfile_fallback(self, transp, file, offset, count): read = await self.run_in_executor(None, file.readinto, view) if not read: return total_sent # EOF - await proto.drain() transp.write(view[:read]) + await proto.drain() total_sent += read finally: if total_sent > 0 and hasattr(file, 'seek'): diff --git a/Tools/tsan/suppressions_free_threading.txt b/Tools/tsan/suppressions_free_threading.txt index b0d64d36996920..fd47c85af1adb1 100644 --- a/Tools/tsan/suppressions_free_threading.txt +++ b/Tools/tsan/suppressions_free_threading.txt @@ -13,9 +13,11 @@ # These warnings trigger directly in a CPython function. race_top:assign_version_tag +race_top:_multiprocessing_SemLock_acquire_impl race_top:_Py_slot_tp_getattr_hook race_top:dump_traceback race_top:fatal_error +race_top:_multiprocessing_SemLock_release_impl race_top:_PyFrame_GetCode race_top:_PyFrame_Initialize race_top:_PyObject_TryGetInstanceAttribute From e161f43ea352eca43fbe1d2ae683bf521f07cd8f Mon Sep 17 00:00:00 2001 From: "blurb-it[bot]" <43283697+blurb-it[bot]@users.noreply.github.com> Date: Mon, 17 Mar 2025 18:50:45 +0000 Subject: [PATCH 3/3] =?UTF-8?q?=F0=9F=93=9C=F0=9F=A4=96=20Added=20by=20blu?= =?UTF-8?q?rb=5Fit.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../next/Library/2025-03-17-18-50-39.gh-issue-131325.wlasMF.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 Misc/NEWS.d/next/Library/2025-03-17-18-50-39.gh-issue-131325.wlasMF.rst diff --git a/Misc/NEWS.d/next/Library/2025-03-17-18-50-39.gh-issue-131325.wlasMF.rst b/Misc/NEWS.d/next/Library/2025-03-17-18-50-39.gh-issue-131325.wlasMF.rst new file mode 100644 index 00000000000000..6c1f64eee6ad02 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2025-03-17-18-50-39.gh-issue-131325.wlasMF.rst @@ -0,0 +1 @@ +Fix sendfile fallback implementation to drain data after writing to transport in :mod:`asyncio`.