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

Avoid 'Collection was modified' InvalidOperationException #6935

Merged
merged 1 commit into from
Sep 14, 2023

Conversation

mavasani
Copy link
Contributor

Fixes #6929

Ensure that we do not perform any state updates to the dataflow CoreAnalysisData inside the loop for the method ClearOverlappingAnalysisDataForIndexedEntity. We instead collect the key-value pairs to be updated in the loop, and perform these updates after the loop.

I haven't been able to come up with a minimal repro case that reproduces this exception, but the loop for which exception was generated can no longer perform any state updates, so we can be quite certain the underlying exception can no longer be thrown.

Fixes dotnet#6929

Ensure that we do not perform any state updates to the dataflow CoreAnalysisData inside the loop for the method `ClearOverlappingAnalysisDataForIndexedEntity`. We instead collect the key-value pairs to be updated in the loop, and perform these updates after the loop.

I haven't been able to come up with a minimal repro case that reproduces this exception, but the loop for which exception was generated can no longer perform any state updates, so we can be quite certain the underlying exception can no longer be thrown.
@mavasani mavasani requested a review from a team as a code owner September 14, 2023 04:05
Copy link
Member

@carlossanlop carlossanlop left a comment

Choose a reason for hiding this comment

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

LGTM.

FYI we recently enabled the backporting bot for this repo: #6892 so that an 8.0 PR gets autocreated for you. You only need to write this comment in this PR:

/backport to release/8.0.1xx

@mavasani mavasani enabled auto-merge September 14, 2023 04:15
@mavasani mavasani merged commit 0c5fe38 into dotnet:main Sep 14, 2023
@mavasani
Copy link
Contributor Author

/backport to release/8.0.1xx

@github-actions
Copy link
Contributor

Started backporting to release/8.0.1xx: https://github.com/dotnet/roslyn-analyzers/actions/runs/6180952187

@github-actions
Copy link
Contributor

@mavasani an error occurred while backporting to release/8.0.1xx, please check the run log for details!

Error: @mavasani is not a repo collaborator, backporting is not allowed. If you're a collaborator please make sure your dotnet team membership visibility is set to Public on https://github.com/orgs/dotnet/people?query=mavasani

@mavasani
Copy link
Contributor Author

/backport to release/8.0.1xx

@github-actions
Copy link
Contributor

Started backporting to release/8.0.1xx: https://github.com/dotnet/roslyn-analyzers/actions/runs/6180962334

@mavasani
Copy link
Contributor Author

@mavasani an error occurred while backporting to release/8.0.1xx, please check the run log for details!

Error: @mavasani is not a repo collaborator, backporting is not allowed. If you're a collaborator please make sure your dotnet team membership visibility is set to Public on https://github.com/orgs/dotnet/people?query=mavasani

FYI @Youssef1313 This is probably the reason why my PRs were getting marked with community label. I have made this fix now. We can probably close out #6372

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants