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

[fix] Copy the keys of RunStatusReporter.timed_tasks before iterating them #3256

Merged
merged 2 commits into from
Dec 5, 2024

Conversation

VassilisVassiliadis
Copy link
Contributor

Iterating the dictionary self.timed_tasks sometimes raises the following exception:

RuntimeError: dictionary changed size during iteration

This PR resolves #3181

https://github.com/GuHongyang actually included the fix to the issue they opened ( #3181 )

@CLAassistant
Copy link

CLAassistant commented Nov 26, 2024

CLA assistant check
All committers have signed the CLA.

@mihran113
Copy link
Contributor

Hey @VassilisVassiliadis! Thanks a lot for opening the fix. Can I just ask you to update the changelog as well?

@alberttorosyan alberttorosyan changed the title fix: copy the keys of RunStatusReporter.timed_tasks before iterating them [fix] Copy the keys of RunStatusReporter.timed_tasks before iterating them Dec 5, 2024
Iterating the dictionary self.timed_tasks sometimes raises the
following exception:

> RuntimeError: dictionary changed size during iteration

The solution is to copy the keys of RunStatusReporter.timed_tasks
before iterating over them

Signed-off-by: Vassilis Vassiliadis <[email protected]>
@VassilisVassiliadis
Copy link
Contributor Author

Hi @mihran113 I rebased my PR and added an entry in the Changelog.

Copy link
Member

@alberttorosyan alberttorosyan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mihran113 mihran113 merged commit 8c51301 into aimhubio:main Dec 5, 2024
1 check passed
@mihran113
Copy link
Contributor

Hey @VassilisVassiliadis. Sorry, there was some mistiming, I pushed some changes to the main in the meantime, but I've resolved the conflicts and merged the PR. Thanks again.

@VassilisVassiliadis
Copy link
Contributor Author

Thank you!

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.

RuntimeError: dictionary keys changed during iteration
4 participants