Skip to content

fix: check update mutex before claiming instance ownership - #336253

Merged
Robo (deepak1556) merged 3 commits into
mainfrom
robo/fix_locked_user_resources_windows
Sep 15, 2026
Merged

Robo (deepak1556) merged 3 commits into
mainfrom
robo/fix_locked_user_resources_windows

Conversation

@deepak1556

Copy link
Copy Markdown
Collaborator

Fixes #335295

This prevents a manually launched instance from briefly claiming singleton
ownership while the update is still completing. Without this ordering, the
new instance could make itself discoverable and begin using the shared user
data before it detects the update mutex and exits, potentially overlapping
with processes from the version being replaced.
@deepak1556 Robo (deepak1556) added this to the 1.139.0 milestone Sep 15, 2026
@deepak1556 Robo (deepak1556) self-assigned this Sep 15, 2026
Copilot AI balanced review requested due to automatic review settings September 15, 2026 10:26
@deepak1556
Robo (deepak1556) enabled auto-merge (squash) September 15, 2026 10:26

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.

Copilot review overview

🟡 Changes recommended

Secondary launches no longer forward to an existing instance while a background update holds the mutex.

Get a fresh assessment by requesting another Copilot review.

Review tier: Balanced
Findings: 1 High severity

Open (1)
What changed in this PR

Moves the Windows update mutex check before instance ownership to avoid startup races.

Changes:

  • Reorders update mutex validation before IPC ownership.
  • Bumps the Windows updater package version.
File Description
src/​vs/​code/​electron-main/​main.ts Reorders mutex and instance checks.
build/​win32/​Cargo.toml Bumps updater version.
build/​win32/​Cargo.lock Synchronizes locked version.

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

Comment thread src/vs/code/electron-main/main.ts Resolved
@deepak1556
Robo (deepak1556) marked this pull request as draft September 15, 2026 10:31
auto-merge was automatically disabled September 15, 2026 10:31

Pull request was converted to draft

Preserve normal secondary instance behavior while a background update is
running by first attempting to claim the main IPC server. If another
instance already owns it, continue connecting and forwarding the launch
without waiting for inno setup.

When this process would otherwise become the primary instance, check the
updating mutex. Release the provisional IPC server before waiting so
other launches cannot connect to a process that has not completed startup,
then retry instance ownership after the update finishes.

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.

Copilot review overview

🟢 Approval recommended

The revised ordering preserves secondary-instance forwarding while preventing startup during the final update transition.

Review tier: Balanced
Findings: None

Resolved since last review (1)

@adhixmartinez-sudo adhixmartinez-sudo 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.

☀️

@deepak1556
Robo (deepak1556) merged commit a1dab1c into main Sep 15, 2026
34 checks passed
@deepak1556
Robo (deepak1556) deleted the robo/fix_locked_user_resources_windows branch September 15, 2026 12:33
@vs-code-engineering vs-code-engineering Bot locked and limited conversation to collaborators Oct 30, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

markdown file md preview is not openeing after last update to recent version

5 participants