Repository navigation
Wait for a slow scheduler start, and fail at once on a crash - #89
Merged
Merged
Conversation
fleet-ctl.sh gave the scheduler 30 health checks, two seconds apart, before it reported "scheduler is not healthy" and suggested a rollback. A scheduler reads every job and command record it keeps before it listens: on a control host with about 45,000 job and 69,000 command records that took 71 seconds, so the v0.1.10 upgrade reported a healthy scheduler as failed. The wait is now a deadline, FLEET_CTL_HEALTH_WAIT seconds (default 300), and it ends at once when the scheduler's container exits or restarts, so a crash still fails fast. The script says once that it is waiting, and why. Tests cover a slow start, a restart and the deadline; each fails on the previous script.
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.
What happened
The v0.1.10 control-host upgrade ended with
fleet-ctl: scheduler is not healthy; run: fleet-ctl.sh scheduler rollback, but the scheduler was fine. Before it listens, a scheduler reads every job and command record it keeps. On a control host with about 45,000 job and 69,000 command records (455 MB), it logged "state loaded" at 12:54:25 and "listening" at 12:55:37: 71 seconds.fleet-ctl.shgave up after 30 health checks two seconds apart, about a minute. The scheduler was healthy from the next check on, and no rollback was needed.Change
deploy/fleet-ctl.sh):scheduler upgradeandscheduler rollbackwait up toFLEET_CTL_HEALTH_WAITseconds (default 300) for/healthz.docs/maintenance.md): why the restart can take minutes, and the setting.Tests
test_a_scheduler_that_starts_slowly_is_waited_fortest_a_scheduler_that_restarts_fails_at_oncetest_a_scheduler_that_never_answers_fails_at_the_deadlinepython -m pytest -q bridge/tests deploy/testspasses. The container check was also run read-only against the real control host, where it readsrunning 0.Not changed
Startup still reads every record. Purging old job history (
fleetctl job purge --older-than DAYS) shortens it; loading only what's in flight is a separate change.