Skip to content

Move Docker call outside network lock - #41362

Open
beena352 wants to merge 1 commit into
microsoft:masterfrom
beena352:users/beenachauhan/networks-list-lock-ordering
Open

Move Docker call outside network lock#41362
beena352 wants to merge 1 commit into
microsoft:masterfrom
beena352:users/beenachauhan/networks-list-lock-ordering

Conversation

@beena352

@beena352 beena352 commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Summary of the Pull Request

WSLCSession::ListNetworks was holding m_networksLock while making the Docker /networks HTTP call. Since ListNetworks only reads from m_networks, the lock is only needed when accessing the cache, not during the Docker call.
This matches the existing pattern in WSLCVolumes::ListVolumes, which makes the Docker call first and then acquires the cache lock. There is no known user-visible issue; this change just avoids holding the lock during I/O.

PR Checklist

  • Closes: Link to issue #xxx
  • Communication: I've discussed this with core contributors already. If work hasn't been agreed, this work might be rejected
  • Tests: Added/updated if needed and all pass
  • Localization: All end user facing strings can be localized
  • Dev docs: Added/updated if needed
  • Documentation updated: If checked, please file a pull request on our docs repo and link it here: #xxx

Detailed Description of the Pull Request / Additional comments

Validation Steps Performed

Copilot AI lite review requested due to automatic review settings August 14, 2026 22:19

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 reduces lock contention in the Windows-side WSLC session network listing path by avoiding holding m_networksLock across the Docker network-list HTTP round trip in WSLCSession::ListNetworks.

Changes:

  • Moves acquisition of m_networksLock to after the (filtered) m_runtime.Docker().ListNetworks(filters) call.
  • Keeps locking scoped to only protecting access to the m_networks cache during sizing and iteration.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@beena352
beena352 marked this pull request as ready for review August 14, 2026 22:53
@beena352
beena352 requested review from a team as code owners August 14, 2026 22:53
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.

2 participants