Skip to content

fix(app): handle startup and shutdown lifecycle failures - #95

Merged
nick2781 merged 4 commits into
mainfrom
fix/application-drain-lifecycle
Oct 20, 2026
Merged

nick2781 merged 4 commits into
mainfrom
fix/application-drain-lifecycle

Conversation

@nick2781

@nick2781 nick2781 commented Oct 20, 2026 •

Copy link
Copy Markdown
Member

Handle application lifecycle failures consistently. Startup failures now identify their plugin/module and phase, stop later startup callbacks and exit with status 1. Missing libraries, missing entry points and standard/nonstandard exceptions retain diagnostic context.

During shutdown, accepted work drains before teardown. Add --shutdown_timeout_ms (default 0, unlimited); failed updates or expired cooperative waits retain resources and report failure once. Late completion cannot resume teardown. On Windows, capture C++ update exceptions before the structured-exception filter and rethrow after returning to the shutdown owner, preserving native structured-fault handling.

Real-process regressions cover loader/startup failures, admission sealing, callback retirement, native thread completion, normal drains, standard/nonstandard exceptions and invalid or expired deadlines. English and Chinese guides describe the lifecycle contract.

Validation: head 54be9e0babb8d740218ee244b2ea58ef913b675b has the identical Git file tree to locally tested 13cc8cb499f34bae784815f645a3fca6b2da84fe. That tree passed macOS Debug complete check-core (including startup and drain processes), 71 CI policy tests, whole-project clang-format 18 and Nimbus checks (123 HTML pages / 217 references).

Fresh Windows and the complete merge-candidate matrix remain required. Cooperative deadlines cannot interrupt a blocking user hook or unload call. Test-harness termination is not successful shutdown. Partial-start resource rollback, hot replacement and general shared-library unloading safety remain separate work.

@nick2781
nick2781 enabled auto-merge October 20, 2026 01:40
@nick2781
nick2781 added this pull request to the merge queue Oct 20, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Oct 20, 2026
@nick2781
nick2781 added this pull request to the merge queue Oct 20, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Oct 20, 2026
@nick2781
nick2781 enabled auto-merge October 20, 2026 03:22
Report plugin/module ownership and the failed startup phase, stop subsequent startup callbacks and return failure. Preserve the accepted shutdown exception boundary and resource-retention safeguards.
@nick2781
nick2781 disabled auto-merge October 20, 2026 03:29
@nick2781 nick2781 changed the title fix(app): retain resources when shutdown draining fails fix(app): handle startup and shutdown lifecycle failures Oct 20, 2026
@nick2781
nick2781 enabled auto-merge October 20, 2026 03:29
@nick2781
nick2781 added this pull request to the merge queue Oct 20, 2026
Merged via the queue into main with commit 652f153 Oct 20, 2026
8 checks passed
@nick2781
nick2781 deleted the fix/application-drain-lifecycle branch October 20, 2026 04:25
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