Skip to content

Preserve newer debugger stop details during continued cleanup - #339530

Merged
Connor Peet (connor4312) merged 1 commit into
microsoft:mainfrom
rksharma-owg:codex/debug-stop-record-race
Oct 8, 2026
Merged

Connor Peet (connor4312) merged 1 commit into
microsoft:mainfrom
rksharma-owg:codex/debug-stop-record-race

Conversation

@rksharma-owg

Copy link
Copy Markdown
Contributor

Fixes #339076.

A quick continued → stopped sequence can leave a thread paused while its Call Stack pause reason is missing. The continued handler removes session stop details after awaiting thread-status scheduling, so it can also remove a newer stop recorded during that wait.

Clear the affected session stop details when the continued event arrives, matching the existing eager recording of stopped events. Thread cancellation and cleanup remain scheduled. Single-thread continuation preserves other threads' records; all-thread continuation clears earlier records, including stops without a thread ID.

Add six tests using DebugSession and RawDebugSession with a fake protocol adapter. They cover newer single/all-thread stops, ordinary continuation, an unaffected stopped thread, and an all-thread stop without a thread ID. Three defect assertions fail against unmodified main and pass with the change.

Validation for 7850f8fac1e91b5b6e45a04eecd15027dcb56a3b, based on main 5983cda0c8126417e5a9cdf33d0be2f4000d3f04:

  • Cloud browser debugger suites: 120 passed each on Linux/Windows Chromium and macOS WebKit; baseline suites passed 114 each.
  • Cloud Electron debugger suites: 137 passed on Linux/macOS, with one existing Windows-only test skipped; 138 passed on Windows.
  • Source type checking, targeted hygiene/ESLint, module layers, class field initialization, TypeScript security compiler and diff checks passed.
  • Repository-wide JavaScript/TypeScript CodeQL analysis completed and uploaded its results.
  • Local macOS arm64 debugger suites and static checks also passed.

Fork validation: cross-platform/source checks, Linux Electron rerun. The initial Linux Electron job failed before tests due to sandbox-helper permissions; the corrected runner passed. Fork-only workflow commits are excluded from this PR.

Copilot AI balanced review requested due to automatic review settings October 4, 2026 00:36

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 narrowly scoped event-ordering fix has focused regression coverage and no unresolved findings.

Review effort: Balanced
Findings: None

What changed in this PR

Fixes #339076 by preserving newer debugger stop details, preventing the Call Stack pause reason from disappearing after rapid continue/stop events.

Changes:

  • Clears affected stop records immediately on continuation, leaving thread cleanup scheduled.
  • Adds six regression tests covering event ordering and single/all-thread continuation.
File Description
src/​vs/​workbench/​contrib/​debug/​test/​browser/​debugSession.test.ts Adds continuation regression tests using a fake adapter.
src/​vs/​workbench/​contrib/​debug/​browser/​debugSession.ts Moves stop-record cleanup before asynchronous scheduling.

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@connor4312 Connor Peet (connor4312) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

thanks!

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.

Call Stack pause header disappears when continued cleanup removes a newer stopped event

5 participants