Skip to content

Fix a race condition in CompilationWithAnalyzers#57260

Merged
mavasani merged 1 commit intodotnet:mainfrom
mavasani:FixRaceCondition
Oct 22, 2021
Merged

Fix a race condition in CompilationWithAnalyzers#57260
mavasani merged 1 commit intodotnet:mainfrom
mavasani:FixRaceCondition

Conversation

@mavasani
Copy link
Copy Markdown
Contributor

#56844 (merged a day ago) introduced a race condition wherein if we reuse the same CompilationWithAnalyzers instance for computing compiler semantic diagnostics for both line span (lightbulb) and full file span (background analysis for squiggles and error list), we end up reporting duplicate diagnostics from CompilationWithAnalyzers. This leads to seeing these duplicates in the error list. This change fixes that by ensuring we dedupe the reported compiler semantic diagnostics from CompilationWithAnalyzers.

Added unit test scenario in this PR fails due to duplicate diagnostics prior to the product fix and should act as a regression test for this issue.

Added unit test scenario in this PR fails due to duplicate diagnostics prior to the product fix and should add as a regression test.
@mavasani mavasani added this to the 17.1 milestone Oct 20, 2021
@mavasani mavasani requested review from a team, 333fred and cston October 20, 2021 12:49
@mavasani mavasani merged commit cb28e28 into dotnet:main Oct 22, 2021
@mavasani mavasani deleted the FixRaceCondition branch October 22, 2021 17:10
@ghost ghost modified the milestones: 17.1, Next Oct 22, 2021
@RikkiGibson RikkiGibson modified the milestones: Next, 17.1.P1 Oct 25, 2021
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.

4 participants