Skip to content

refactor: unify debugger session cleanup - #35

Merged
derekparker merged 1 commit into
refactor/atomic-dap-requestsfrom
refactor/unified-session-cleanup
Sep 23, 2026
Merged

derekparker merged 1 commit into
refactor/atomic-dap-requestsfrom
refactor/unified-session-cleanup

Conversation

@derekparker

Copy link
Copy Markdown
Member

Summary

Route established-session termination through one idempotent cleanup sequence:

  • explicit stop and detach
  • startup rollback
  • server shutdown
  • DAP termination events
  • transport EOF/read failure and inbox overflow

The DAP client installs an immutable lifecycle callback before its read loop starts. Lifecycle notification is synchronous; terminal state is published first so active waiters can release the session lock. Owner-driven cleanup uses an internal transport shutdown that cannot recursively notify the owner.

This PR also:

  • replaces per-debug-session state in one operation during cleanup
  • preserves stable controller configuration across sessions
  • joins transport close errors
  • propagates os.Getwd failures from GDB launch setup
  • adds cleanup regression coverage
  • applies the remaining production formatting and small result-construction cleanup

Stack

Verification

  • go fix -diff ./...
  • go vet ./...
  • go test -race -count=1 ./...
  • git diff --check

@derekparker
derekparker added this pull request to stack #36 September 23, 2026 18:49
@derekparker
derekparker force-pushed the refactor/unified-session-cleanup branch from f5f07c3 to c287f8d Compare September 23, 2026 18:50
@derekparker
derekparker merged commit 6523231 into master Sep 23, 2026
3 checks passed
@derekparker
derekparker deleted the refactor/unified-session-cleanup branch September 23, 2026 18:58
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.

1 participant