fix: preserve models and reject exiting dispatch leaders - #2497
Merged
limityan merged 2 commits intoAug 25, 2026
Conversation
This was referenced Aug 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
app.telemetryvalues tofalsebefore typed configuration deserializationpsreports as exiting before SIGKILL escalationConfiguration compatibility root cause
Older builds deserialize
app.telemetryas a boolean. A configuration written with the newer structured telemetry shape fails typed deserialization; the smart merge preserves that incompatible object, fails again, and activates in-memory defaults. The model configuration remains on disk but appears empty in the running application.app.telemetryfalsemacOS cancellation root cause
The failing CLI test exposed a real exit-window race.
kill(pid, 0)still observes an exiting leader, while macOSpsadds theEmodifier when a process is trying to exit. The previous zombie-only check accepted states such asSEandUEs, re-authenticated the leader, and allowed SIGKILL escalation after SIGTERM had already caused it to exit.The fix accepts only known live primary states (
I,R,S,T,U) without theEmodifier. Empty, zombie, exiting, and unknown states fail closed. Signal ordering and timeout behavior are unchanged.The identical failure also occurred on
mainin CI run 32746613875, before this PR, and recurred in this PR's run 32842242028. This PR now carries the root-cause fix instead of relying on a rerun.Verification
pnpm run fmt:rscargo test -p bitfun-core --no-default-features --lib service::config— 93 passedcargo test -p bitfun-cli --bin bitfun macos_ -- --nocapture— 3 passedcargo test -p bitfun-cli --bin bitfun dispatch::runner::tests -- --nocapture— 6 passed on Windows; Unix-specific process tests are exercised by CIcargo test -p bitfun-cli --bin bitfun— 682 passed on Windowsgit diff --check