Skip to content

mgr/progress: fix dictionary change during iteration error - #28840

Closed
kamoltat wants to merge 1 commit into
ceph:masterfrom
kamoltat:wip-mgr-progress-fix-dictionary-change-iteration
Closed

kamoltat wants to merge 1 commit into
ceph:masterfrom
kamoltat:wip-mgr-progress-fix-dictionary-change-iteration

Conversation

@kamoltat

@kamoltat kamoltat commented Jul 2, 2019 •

Copy link
Copy Markdown
Member

Provide a fix for the bug where
there is runtime error for when
dictionary change during iteration.
Fix by just making a copy of the
dictionary using list()

Fixes: http://tracker.ceph.com/issues/40618
Signed-off-by: Kamoltat (Junior) Sirivadhna [email protected]

  • References tracker ticket
  • Updates documentation if necessary
  • Includes tests for new functionality or reproducer for bug

Provide a fix for the bug where
there is runtime error for when
dictionary change during iteration.
Fix by just making a copy of the
dictionary using list()

Signed-off-by: Kamoltat (Junior) Sirivadhna <[email protected]>
@tchaikov
tchaikov self-requested a review July 2, 2019 15:01
@neha-ojha

Copy link
Copy Markdown
Member

Hey @kamoltat, could you include the tracker reference for the bug that this PR is fixing in the commit message? See https://github.com/ceph/ceph/blob/master/SubmittingPatches.rst#tag-the-commit

@jdurgin

jdurgin commented Jul 2, 2019

Copy link
Copy Markdown
Member

if it's possible for a 2nd thread to change the dictionary, do we need to introduce a lock for accessing it instead?

@jdurgin jdurgin left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I see what you mean now, about changing the dictionary during the loop. Looks good!

@tchaikov

Copy link
Copy Markdown
Contributor

Comment thread src/pybind/mgr/progress/module.py Resolved
@sebastian-philipp

Copy link
Copy Markdown
Contributor

any update on this?

@jdurgin

jdurgin commented Sep 13, 2019

Copy link
Copy Markdown
Member

superseded by #29035

@jdurgin jdurgin closed this Sep 13, 2019
@sebastian-philipp

Copy link
Copy Markdown
Contributor

also #29807

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants