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

Add lock on _checkRegistry operations #11361

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

YuliiaKovalova
Copy link
Member

@YuliiaKovalova YuliiaKovalova commented Jan 30, 2025

Fixes #11319

Context

It looks like the environment modifies _checkRegistry concurrently due to throttling logic

foreach (var throttledCheck in _checkRegistry.FindAll(c => c.MaterializedCheck?.IsThrottled ?? false))

and

private void RemoveCheck(CheckFactoryContext checkToRemove)

In RemoveChecksAfterExecutedActions the code is processing throttled checks and RemoveCheck method is modifying the _checkRegistry while the FindAll loop is still iterating over it.

Changes Made

add lock for the _checkRegistry operations to avoid issues with synchronization.

@YuliiaKovalova YuliiaKovalova marked this pull request as draft January 30, 2025 12:39
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.

BuildCheck throws exception when enabled in Roslyn Repo
1 participant