KEMBAR78
[3.12] gh-122208: Don't delivery PyDict_EVENT_ADDED until it can't fail by DinoV · Pull Request #122327 · python/cpython · GitHub
Skip to content

Conversation

@DinoV
Copy link
Contributor

@DinoV DinoV commented Jul 26, 2024

Currently PyDict_EVENT_ADDED can be delivered when the insert is going to fail due to an OOM. This means the listener has no capability of knowing the true state of the dictionary if it fails.

This modifies the events to be delivaered before the change has happened but only after any underlying necessary allocations have occurred.

Backported from main: #122207

@DinoV DinoV marked this pull request as ready for review July 26, 2024 22:00
@DinoV DinoV requested a review from carljm July 27, 2024 00:05
@DinoV DinoV merged commit c8f5ca6 into python:3.12 Jul 30, 2024
Sign up for free to 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.

2 participants