Skip to content

[3.14] gh-159739: Skip context watchers cleared during notification (GH-160164) - #160289

Merged
JelleZijlstra merged 1 commit into
python:3.14from
miss-islington:backport-0a57626-3.14
Oct 22, 2026
Merged

JelleZijlstra merged 1 commit into
python:3.14from
miss-islington:backport-0a57626-3.14

Conversation

@miss-islington

@miss-islington miss-islington commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

A context watcher callback can clear a later watcher while a context-switch notification is being dispatched. The dispatcher still uses its earlier snapshot of active watchers, so it calls a NULL callback and crashes; check that each callback is still registered before invoking it. Backport to 3.15 and 3.14.
(cherry picked from commit 0a57626)

Co-authored-by: Jelle Zijlstra jelle@openai.com

…ythonGH-160164)

A context watcher callback can clear a later watcher while a context-switch notification is being dispatched. The dispatcher still uses its earlier snapshot of active watchers, so it calls a NULL callback and crashes; check that each callback is still registered before invoking it. Backport to 3.15 and 3.14.
(cherry picked from commit 0a57626)

Co-authored-by: Jelle Zijlstra <jelle@openai.com>
@miss-islington
miss-islington requested a review from 1st1 as a code owner October 22, 2026 18:22
@JelleZijlstra
JelleZijlstra enabled auto-merge (squash) October 22, 2026 22:20
@JelleZijlstra
JelleZijlstra merged commit ddf7156 into python:3.14 Oct 22, 2026
51 checks passed
@miss-islington
miss-islington deleted the backport-0a57626-3.14 branch October 22, 2026 22:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants