Skip to content

ParallelOptions not being passed to Parallel.ForEachAsync in FindAppHostProjectFilesAsync #9661

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

Conversation

SimonCropp
Copy link
Contributor

@SimonCropp SimonCropp commented Jun 3, 2025

Checklist

  • Is this feature complete?
    • Yes. Ready to ship.
    • No. Follow-up changes expected.
  • Are you including unit tests for the changes and scenario tests if relevant?
    • Yes
    • No
  • Did you add public API?
    • Yes
      • If yes, did you have an API Review for it?
        • Yes
        • No
      • Did you add <remarks /> and <code /> elements on your triple slash comments?
        • Yes
        • No
    • No
  • Does the change make any security assumptions or guarantees?
    • Yes
      • If yes, have you done a threat model and had a security review?
        • Yes
        • No
    • No
  • Does the change require an update in our Aspire docs?

@Copilot Copilot AI review requested due to automatic review settings June 3, 2025 10:52
@github-actions github-actions bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Jun 3, 2025
@dotnet-policy-service dotnet-policy-service bot added the community-contribution Indicates that the PR has been added by a community member label Jun 3, 2025
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.

Pull Request Overview

This PR ensures that the configured ParallelOptions (specifically MaxDegreeOfParallelism) is actually passed into the Parallel.ForEachAsync call in FindAppHostProjectFilesAsync, fixing an oversight where parallel options were never applied.

  • Pass parallelOptions into Parallel.ForEachAsync.
  • No other functional changes.

@@ -41,7 +41,7 @@ private async Task<List<FileInfo>> FindAppHostProjectFilesAsync(DirectoryInfo se
MaxDegreeOfParallelism = Environment.ProcessorCount
};

await Parallel.ForEachAsync(projectFiles, async (projectFile, ct) =>
await Parallel.ForEachAsync(projectFiles, parallelOptions, async (projectFile, ct) =>
Copy link
Member

Choose a reason for hiding this comment

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

appHostProjects needs to have a lock around it or be concurrent collection.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i think that is this pr #9655

Copy link
Member

@mitchdenny mitchdenny left a comment

Choose a reason for hiding this comment

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

collection change is now on main so this can go in.

@mitchdenny mitchdenny merged commit 3aa6a3d into dotnet:main Jun 11, 2025
255 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Jul 11, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
community-contribution Indicates that the PR has been added by a community member needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants