Skip to content

WIP: Add concurrency for parent packages - #2016

Open
alerickson wants to merge 25 commits into
masterfrom
parentPkgConcurrency
Open

WIP: Add concurrency for parent packages#2016
alerickson wants to merge 25 commits into
masterfrom
parentPkgConcurrency

Conversation

@alerickson

Copy link
Copy Markdown
Member

PR Summary

PR Context

PR Checklist

alerickson and others added 13 commits June 30, 2026 13:56
InstallPackageAsync was calling the synchronous InstallPackage() which
writes to _cmdletPassedIn.WriteDebug, causing cross-thread cmdlet stream
writes when used from Parallel.ForEach.

- Refactor InstallPackageAsync to not call InstallPackage(); inline the
  null-version check and enqueue all messages via the provided queues
- Add a queue-aware InstallVersion overload that uses ConcurrentQueue
  parameters instead of _cmdletPassedIn.Write* calls, for use by the
  async install path
- Keep the original InstallVersion(out ErrorRecord) overload intact for
  the synchronous path
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings July 24, 2026 23:11
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

@alerickson

Copy link
Copy Markdown
Member Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

Copilot AI left a comment

Copy link
Copy Markdown

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 is working toward enabling concurrent (parallel) package resolution/installation workflows by adding async server API entry points and refactoring parent-package installation to separate pipeline-thread operations (ShouldProcess/host output) from worker-thread network/download work.

Changes:

  • Implemented async Find*Async / InstallPackageAsync overrides across multiple server API call implementations.
  • Refactored InstallHelper.InstallPackages() into a 3-phase model (pipeline-thread gating, parallel downloads, pipeline-thread finalization) with per-parent message queues.
  • Updated dependency resolution in FindHelper to allow concurrent dependency-closure computation and to reduce shared mutable state.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 10 comments.

Show a summary per file
File Description
src/code/V3ServerAPICalls.cs Implements async find/install paths and routes diagnostics through concurrent queues for V3 feeds.
src/code/V2ServerAPICalls.cs Adjusts async pagination loop to use the async helper for subsequent pages.
src/code/NuGetServerAPICalls.cs Adds async find/install methods and a queue-based HTTP helper for some async paths.
src/code/LocalServerApiCalls.cs Adds basic async wrappers for local repository find/install operations.
src/code/InstallHelper.cs Refactors parent install flow into phases and introduces parallel parent/dependency download work items.
src/code/FindHelper.cs Enables concurrent dependency resolution and attempts to localize state for thread safety.
src/code/ContainerRegistryServerAPICalls.cs Adds async wrappers for container registry find/install operations.
Comments suppressed due to low confidence (1)

src/code/FindHelper.cs:1222

  • This method drains queued messages by calling Utils.WriteOutConcurrentQueue(_cmdletPassedIn, ...) inside FindHelper. When invoked from worker threads (e.g., during parallel parent installs), this will write to cmdlet streams off the pipeline thread. Message draining should be done by the top-level pipeline-thread caller (like InstallHelper Phase 3), not inside this helper.
                }

                Utils.WriteOutConcurrentQueue(_cmdletPassedIn, errorMsgs, warningMsgs, debugMsgs, verboseMsgs);
            }

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/code/NuGetServerAPICalls.cs Outdated
Comment thread src/code/V3ServerAPICalls.cs Outdated
Comment thread src/code/V2ServerAPICalls.cs
Comment thread src/code/InstallHelper.cs
Comment thread src/code/FindHelper.cs Outdated
Comment thread src/code/NuGetServerAPICalls.cs
Comment thread src/code/InstallHelper.cs
Comment thread src/code/NuGetServerAPICalls.cs
Comment thread src/code/ContainerRegistryServerAPICalls.cs
Comment thread src/code/NuGetServerAPICalls.cs Outdated
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines will not run the associated pipelines, because the pull request was updated after the run command was issued. Review the pull request again and issue a new run command.

@alerickson

Copy link
Copy Markdown
Member Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

alerickson and others added 3 commits July 31, 2026 14:31
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@alerickson

Copy link
Copy Markdown
Member Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

@alerickson

Copy link
Copy Markdown
Member Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

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.

3 participants