Skip to content

Conversation

@miss-islington
Copy link
Contributor

@miss-islingtonmiss-islington commented Nov 26, 2025

Added atomic operations to scanner_begin() and scanner_end() to prevent
race conditions on the executing flag in free-threaded builds. Also added
tests for concurrent usage of the re module.

Without the atomic operations, test_scanner_concurrent_access() triggers
assert(self->executing) failures, or a thread sanitizer run emits errors.
(cherry picked from commit bc9e63d)

Co-authored-by: Alper alperyoney@fb.com

…ing (pythongh-141923) Added atomic operations to `scanner_begin()` and `scanner_end()` to prevent race conditions on the `executing` flag in free-threaded builds. Also added tests for concurrent usage of the `re` module. Without the atomic operations, `test_scanner_concurrent_access()` triggers `assert(self->executing)` failures, or a thread sanitizer run emits errors. (cherry picked from commit bc9e63d) Co-authored-by: Alper <alperyoney@fb.com>
@colesburycolesbury enabled auto-merge (squash) November 26, 2025 20:41
@colesburycolesbury merged commit f47e928 into python:3.14Nov 26, 2025
49 checks passed
@miss-islingtonmiss-islington deleted the backport-bc9e63d-3.14 branch January 2, 2026 18:38
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@miss-islington@colesbury@yoney