Skip to content

Change list -> ConcurrentBag in BuildCheckContext #11461

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

Merged

Conversation

YuliiaKovalova
Copy link
Member

@YuliiaKovalova YuliiaKovalova commented Feb 19, 2025

Fixes #11439 and #11319

Context

_checkRegistry and _ruleTelemetryData can be accessed in multithreaded environment (from logger and nodes).

Changes Made

List -> ConcurrentBag

Testing

Since it fails on CI, we need to merge the change and check it on preview.

Copy link
Member

@JanKrivanek JanKrivanek left a comment

Choose a reason for hiding this comment

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

Overall looks good

@YuliiaKovalova YuliiaKovalova marked this pull request as ready for review February 19, 2025 15:07
@JanProvaznik JanProvaznik requested a review from Copilot February 19, 2025 22:24
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.

Comments suppressed due to low confidence (1)

src/Build/BuildCheck/Infrastructure/BuildCheckManagerProvider.cs:373

  • Ensure that the new behavior of using FirstOrDefault and Where with ConcurrentBag is covered by tests.
var checkFactory = _checkRegistry.FirstOrDefault(c => c.MaterializedCheck == check);

Copy link
Member

@surayya-MS surayya-MS left a comment

Choose a reason for hiding this comment

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

Looks good to me!

@YuliiaKovalova YuliiaKovalova merged commit 5e2cbf5 into dotnet:main Feb 20, 2025
10 checks passed
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.

Collection was modified; enumeration operation may not execute.: Infrastructure.BuildCheckCentralContext.RunRegisteredActions
4 participants