-
-
Notifications
You must be signed in to change notification settings - Fork 31.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
data race while running test_asyncio.test_sendfile
in TSAN
#131325
Labels
extension-modules
C modules in the Modules dir
topic-asyncio
type-bug
An unexpected behavior, bug, or error
Comments
kumaraditya303
added a commit
that referenced
this issue
Mar 17, 2025
…riting to transport (#131376)
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this issue
Mar 17, 2025
…fter writing to transport (pythonGH-131376) (cherry picked from commit 94f4d87) Co-authored-by: Kumar Aditya <kumaraditya@python.org>
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this issue
Mar 17, 2025
…fter writing to transport (pythonGH-131376) (cherry picked from commit 94f4d87) Co-authored-by: Kumar Aditya <kumaraditya@python.org>
For reference, this was actually a bug in the fallback implementation, the transport needs to be drained after writing and before proceeding to the next iteration. |
colesbury
pushed a commit
to colesbury/cpython
that referenced
this issue
Mar 20, 2025
…fter writing to transport (python#131376)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
extension-modules
C modules in the Modules dir
topic-asyncio
type-bug
An unexpected behavior, bug, or error
TSAN output:
The race happens in
test_sendfile_force_fallback
intest_sendfile
because when the fallback implementation is used, it usesfile.readinto
1 in a thread pool and while writing it uses the buffer protocol which seems to trigger theTSAN warning in
_buffered_readinto_generic
2. The buffer protocol isn't safe because the object is not locked when writing through the exported buffer. I am not sure how to fix this without avoiding the buffer protocol.Linked PRs
Footnotes
https://github.com/python/cpython/blob/3185e3115c918ec189e16cf9f5b51a13a0146556/Lib/asyncio/base_events.py#L965 ↩
https://github.com/python/cpython/blob/3185e3115c918ec189e16cf9f5b51a13a0146556/Modules/_io/bufferedio.c#L1128-L1135 ↩
The text was updated successfully, but these errors were encountered: