Skip to content

fix(backup): give up sooner on addresses that don't answer - #498

Merged
MoonBoi9001 merged 2 commits into
mainfrom
mb9/limit-how-long-startup-waits-for-a-backup
Dec 1, 2026
Merged

MoonBoi9001 merged 2 commits into
mainfrom
mb9/limit-how-long-startup-waits-for-a-backup

Conversation

@MoonBoi9001

@MoonBoi9001 MoonBoi9001 commented Dec 1, 2026 •

Copy link
Copy Markdown
Member

This PR gives each of the backup bucket's addresses 5 seconds to connect instead of 30, so that restoring files at startup is less likely to outlast the 5 minutes Kubernetes allows. With 9 dead addresses and both files missing, a run with waits cut 30 times waited the equivalent of about 195 seconds instead of 549. A very slow download, or a slow sign-in followed by many dead addresses and a slow answer, could still outlast it.

At startup the service fetches a missing file from its backup. The 1 minute limit was checked
only between requests, and 1 request can take 30 seconds for each of the bucket's addresses, so
it could outlast the 5 minutes Kubernetes allows and be killed again and again.
The first version of this limit cut off a whole restore after a minute, which would also have
dropped ones that were slow but working. Each of the bucket's addresses now gets 5 seconds to
connect instead of 30, and a request that connects keeps its full time.
@MoonBoi9001 MoonBoi9001 changed the title fix(backup): stop waiting for a backup after about a minute fix(backup): give up sooner on addresses that don't answer Dec 1, 2026
@MoonBoi9001
MoonBoi9001 marked this pull request as ready for review December 1, 2026 19:02
@MoonBoi9001
MoonBoi9001 merged commit 713bbf6 into main Dec 1, 2026
6 checks passed
@MoonBoi9001
MoonBoi9001 deleted the mb9/limit-how-long-startup-waits-for-a-backup branch December 1, 2026 23:31
MoonBoi9001 pushed a commit that referenced this pull request Dec 1, 2026
**Merge order:** If a `chore(k8s): update cronjob image` PR is open,
land it first. After that PR lands, wait 1-2 minutes for release-please
to force-push this one with the new SHA bump — otherwise you'll need to
land a third PR.
---


##
[2.18.0](v2.17.1...v2.18.0)
(2026-12-01)


### Added

* **health:** say whether the cache file backups are working
([#500](#500))
([69aa529](69aa529))


### Fixed

* **backup:** give up sooner on addresses that don't answer
([#498](#498))
([713bbf6](713bbf6))
* **backup:** never upload scores the service could not use
([#497](#497))
([51d913d](51d913d))
* **backup:** protect a freshness copy that can't be restored
([#499](#499))
([9bd532d](9bd532d))


### Changed

* **deps:** bump the actions group with 5 updates
([#502](#502))
([57550f6](57550f6))
* **k8s:** update cronjob image to sha-57550f6
([#504](#504))
([84afd27](84afd27))

---
**Deploy after merge:** Merging this PR tags the release and triggers
the `Build Release Image` workflow to publish the versioned service
image. Wait for that workflow to finish, then roll it out from an
up-to-date `main`: `kubectl apply -f k8s/deployment.yaml`. Applying
before the build completes leaves the rollout stuck in
`ImagePullBackOff`.

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
MoonBoi9001 added a commit that referenced this pull request Dec 2, 2026
This PR corrects the deployment guide, which said restoring the cache
files at startup takes a few minutes at worst, and the claim in #498's
commit message that a restore can't outlast the 5 minutes Kubernetes
allows. Only each read of a download is timed, so a bucket that sends a
file slowly enough can keep startup going until the startup probe
restarts the container, again and again.
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