Skip to content

ci: fix PR-check bison download failures — deps cache version mismatch, GNU mirror, fail-fast wget - #18

Open
rjd15372 wants to merge 3 commits into
mainfrom
ci-bison-cache-fixes
Open

ci: fix PR-check bison download failures — deps cache version mismatch, GNU mirror, fail-fast wget#18
rjd15372 wants to merge 3 commits into
mainfrom
ci-bison-cache-fixes

Conversation

@rjd15372

Copy link
Copy Markdown
Collaborator

PR-check runs on several branches (Q3release, Q3PG15, tarballs-simpleimage, next-train-bumps) have been failing after ~90 minutes in the --branch-from content check for ppg:common:deps/bison:

Connecting to ftp.gnu.org (ftp.gnu.org)|209.51.188.20|:443... failed: Connection timed out.   (×20)
error: --branch-from content check for isv:percona:ppg:common:deps/bison failed twice while running services

The same URL answers in 0.3 s from outside GitHub; ftp.gnu.org is refusing the runners' IP ranges (later runs got Connection refused). Three independent fixes:

1. Deps cache was invisible to PR runs (cache version mismatch)

sync-main.yml caches four paths (download_url, cargo_vendor, services, sync_state — the last added in b43d0f2); obs-pr-check.yml cached three. actions/cache hashes the path list into the cache version and restore-keys only match the same version, so PR runs logged Cache not found for input keys: …, percona-obs-deps-Linux- while restoring main's scm cache (identical path) just fine. Confirmed via the caches API: main's deps entry has version 04cde50b…, PR #12's eefd799a….

Consequence: a PR without its own deps cache re-downloaded every download_url source on every run, and could only build a cache after a fully successful run (actions/cache does not save on failure) — i.e. never, while ftp.gnu.org blocks runners.

Fix: add .cache/sync_state to obs-pr-check's list and note in both files that the lists must stay identical. Restoring the manifest in PR runs is inert (keyed by apiurl/rootprj, and PRs don't pass --skip-unchanged). download_url entries stay content-addressed by their service params, so a PR that bumps bison still misses and downloads exactly that tarball. Also adds timeout-minutes: 120 to the sync job (healthy runs finish in <30 min; default was 6 h).

2. bison: fetch via ftpmirror.gnu.org

The GNU redirector 302s to a nearby mirror; wget follows it. Verified end-to-end with wget and the download_url service locally. bison is the only package pulling from ftp.gnu.org. (New service params ⇒ new cache key ⇒ one fresh download, then cached.)

3. Fail fast on unreachable download hosts

obs-setup now exports WGETRC with tries = 3, connect_timeout = 30, read_timeout = 120. The download_url service execs wget with defaults (20 tries, multi-minute connect timeout) and exposes no knobs. Measured with the real service against a black-hole address: 2 min 13 s to give up instead of ~45 min (×2 with the content-check retry).

No Python changes.

…heck

actions/cache hashes the 'path' list into the cache *version* and only
matches restore-keys against entries with the same version.  sync-main
(b43d0f2) added .cache/sync_state to its deps cache while obs-pr-check
kept three paths, so the two workflows have been writing incompatible
versions ever since: PR runs reported 'Cache not found for input keys:
..., percona-obs-deps-Linux-' even though main's deps cache existed and
its scm cache (identical path in both) restored fine.

The practical effect was that every PR without a deps cache of its own
re-downloaded every download_url source on each run, and could only
ever build one after a fully successful run -- actions/cache does not
save after a failed job.  That turned an unreachable ftp.gnu.org into a
loop of 90-minute failures.

Add .cache/sync_state to obs-pr-check's list (the manifest is an
optimisation keyed by apiurl/rootprj and PR runs never pass
--skip-unchanged, so restoring it is inert) and leave a note in both
files that the lists must stay identical.  download_url entries remain
content-addressed by their service params, so a PR that bumps a
version still misses and re-downloads exactly that source.

Also give the PR-check sync job a timeout-minutes: 120 backstop; a
healthy run finishes in well under 30 minutes, and until now a stalled
service could hold the job for the 6-hour default.

Signed-off-by: Ricardo Dias <ricardo.dias@percona.com>
ftp.gnu.org throttles/refuses connections from cloud IP ranges; GitHub
Actions runners currently get 'Connection timed out' and then
'Connection refused' on 209.51.188.20:443 while the same URL answers
instantly from elsewhere.  bison is the only package in the tree that
downloads from ftp.gnu.org.

Use the GNU redirector instead: https://ftpmirror.gnu.org/bison/... 302s
to a nearby mirror and wget follows the redirect (verified with both
plain wget and the obs download_url service).  The service params
change, so the download_url cache key changes and the tarball is
fetched once more, then cached.

Signed-off-by: Ricardo Dias <ricardo.dias@percona.com>
The obs download_url service execs wget with its defaults -- 20 tries
and a multi-minute connect timeout each -- and exposes no retry or
timeout knobs.  A host that refuses the runner's IP (ftp.gnu.org this
week) therefore costs ~45 minutes per attempt, doubled by the content
check's retry-once, before the job even fails.

Export WGETRC from the shared obs-setup action with tries=3,
connect_timeout=30 and read_timeout=120.  Every workflow that runs
services goes through obs-setup, and the venv inherits the job env, so
each service-spawned wget picks it up.  Measured with the real service
against a black-hole address: gives up after 2 min 13 s.

Signed-off-by: Ricardo Dias <ricardo.dias@percona.com>
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