Skip to content

The orchestrator crashes on every shutdown: it resolves a service from the disposed provider after Run returns - #571

Merged
AdamFrisby merged 1 commit into
mainfrom
codeybox/95105388
Sep 25, 2026
Merged

AdamFrisby merged 1 commit into
mainfrom
codeybox/95105388

Conversation

@AdamFrisby

Copy link
Copy Markdown
Owner

Automated via CodeyBox — work item 95105388029044ee9c01da7482ad4d08

Initiated by CodeyBox operator


Co-Authored-By: CodeyBox noreply@codeybox.invalid
🤖 Generated with CodeyBox

…ly shutdown

Resolves BackgroundServiceFailureTracker prior to host.Run() in Program.RunHost.
When host.Run() returns, the host and its root service provider have already
been disposed. Looking up BackgroundServiceFailureTracker post-Run() threw
ObjectDisposedException, causing orderly shutdown to abort with SIGABRT and
masking legitimate background-service fault exit code mappings.

Capturing the singleton reference before Run() preserves the tracker across
host disposal, enabling clean termination on normal shutdown and proper
non-zero exit code mapping when a background service faults.

CodeyBox-Prompt-Revision: 1
Co-Authored-By: CodeyBox <noreply@codeybox.invalid>
@AdamFrisby
AdamFrisby merged commit e20d7b4 into main Sep 25, 2026
@AdamFrisby
AdamFrisby deleted the codeybox/95105388 branch September 25, 2026 17:52
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