Skip to content

Preserve command cancellation and clean up failed runtime startup - #704

Merged
wolfy-j merged 2 commits into
mainfrom
fix/runtime-command-cleanup
Sep 10, 2026
Merged

wolfy-j merged 2 commits into
mainfrom
fix/runtime-command-cleanup

Conversation

@wolfy-j

@wolfy-j wolfy-j commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Summary

  • preserve the Cobra command context through runtime bootstrap so cancellation, deadlines, and caller values reach loaded components
  • keep the latest successful load context when a later component fails
  • give each command runtime one cleanup owner shared across pack bootstrap, start, launch, cancellation, and normal shutdown paths
  • clean already-loaded components after load/start failures and make affected dispatchers tolerate cleanup before Start

The change reuses the existing loader and shutdown pipeline. It adds one parent-aware bootstrap entry point and one command-local one-shot cleanup owner; no runtime protocol or configuration surface is introduced.

Regression coverage

Tests cover parent cancellation/value/deadline propagation, partial-load cleanup, pre-start dispatcher cleanup, pack-start failure, normal shutdown, cancellation without a signal, and prevention of duplicate shutdown.

Verification

  • uncached race tests for boot, command runtime, store/WebSocket dispatchers, event bus, and security dispatcher
  • go vet
  • golangci-lint v2.13.2: 0 issues
  • Windows amd64 build of affected packages
  • go mod verify
  • git diff --check

@wolfy-j
wolfy-j marked this pull request as draft September 9, 2026 21:19
@wolfy-j
wolfy-j marked this pull request as ready for review September 9, 2026 21:45
@wolfy-j
wolfy-j force-pushed the fix/runtime-command-cleanup branch from 4dbd7c7 to 884a9b5 Compare September 10, 2026 18:45
@wolfy-j
wolfy-j merged commit a61c062 into main Sep 10, 2026
9 checks passed
@wolfy-j
wolfy-j deleted the fix/runtime-command-cleanup branch September 10, 2026 18:56
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