Repository navigation
ADFA-5280 fix(server): post-batch ensure decides on fresh liveness, not the stale cache - #477
Merged
Conversation
…ot the stale cache ServerController.startEnvironment() fed EnvironmentEnsure.decide() the cached ServerStateRepository.alive, which still reads TRUE right after a module batch's pdsm stop (the 3s poll hasn't caught up), so decide() returned NOOP_HEALTHY and the box was never relaunched — Home "Couldn't start" until a manual Retry. Read liveness from a live probe (RestReadiness.apiReady()) instead: a just-stopped server reads down at once -> KILL_AND_RELAUNCH; a healthy env still reads up -> NOOP_HEALTHY, so no double-boot. The decision already runs off the main thread.
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.
ServerController.startEnvironment()fedEnvironmentEnsure.decide()the cachedServerStateRepository.alive, which still reads TRUE right after a module batch'spdsm stop(the 3s poll hasn't caught up). So the post-batch ensure decidedNOOP_HEALTHYand never relaunched — every UI proot-module install left the boxdown (Home "Couldn't start") until a manual Retry.
Now it reads liveness from a live probe (
RestReadiness.apiReady()): a just-stoppedserver reads down immediately →
KILL_AND_RELAUNCH; a genuinely healthy env stillreads up →
NOOP_HEALTHY, so no double-boot. The decision already runs off the mainthread.
Scope: one line in
startEnvironment(). Safe for all its callers — each brings up ajust-stopped server (module batch, rebuild, backup/restore return, clone release,
manual start toggle); none expects NOOP on a live server.
Verification: install a proot module (Books) from the UI → lands on a live Home with
no Retry; log shows startEnvironment → EnvironmentEnsure decision → pdsm start after
PLAY RECAP.