Skip to content
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

fixed "dictionary changed size during iteration" #517

Merged
merged 1 commit into from
Jan 17, 2023

Conversation

palmieric
Copy link
Contributor

@palmieric palmieric commented Jan 16, 2023

About this change - What it does

This change is needed to avoid the race condition on this line under heavy load.

Why this way

The dict keys() method return a views on the data that could change during the execution, it is needed a copy of them to avoid "RuntimeError: dictionary changed size during iteration". We can get read of the values as they are not needed in this method.

@palmieric palmieric requested review from a team as code owners January 16, 2023 10:33
@jjaakola-aiven jjaakola-aiven merged commit 9ddbcc8 into Aiven-Open:main Jan 17, 2023
@palmieric palmieric deleted the cpalmieri-PM-2744 branch May 2, 2023 13:10
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