Skip to content

fix: retry HTTP 429 after Retry-After and warn if still rate-limited - #954

Merged
fredericsimard merged 2 commits into
masterfrom
fix/check-new-urls-retry-after-v2/2026-11-03
Nov 4, 2026
Merged

fredericsimard merged 2 commits into
masterfrom
fix/check-new-urls-retry-after-v2/2026-11-03

Conversation

@fredericsimard

@fredericsimard fredericsimard commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

The URL check failed on #951 because Entur feed URLs returned HTTP 429 from CI while returning 200 when opened manually.

Entur rate-limits per client, and GitHub Actions runners share IP addresses with many other jobs. This change retries a 429 up to 2 times, waiting for the server's Retry-After delay each time (10 seconds by default, 60 seconds at most).

A URL still returning 429 after that is reported as a warning asking reviewers to open it manually, and does not fail the job. Any other non-2xx status still fails it.

This re-submits b45e7e0 for review; that commit reached master by direct push and was reverted in #953.

Issue came up here https://github.com/MobilityData/gbfs/actions/runs/41620980029/job/126035895493

The "Check new URLs return 2xx" job failed on PR 951 because four Entur feed URLs returned HTTP 429, even though they return 200 when opened manually. Entur rate-limits per client, and GitHub Actions runners share IP addresses with many other jobs, so a working URL can keep returning 429 from CI. The checker treated 429 like any other error status and failed immediately, and re-running the job gave the same result.

- Retry on 429: a URL that returns HTTP 429 is retried up to 2 times. Before each retry the checker waits for the server's Retry-After delay, accepting either seconds or an HTTP date. It waits 10 seconds if the header is missing or unreadable, and never more than 60 seconds.
- Warn instead of fail: a URL that still returns 429 after the retries is reported as a `::warning` annotation asking reviewers to open it manually, and it does not fail the job. Any other non-2xx status or network error still fails it.
- Docs: the script header now describes the 429 handling and the updated meaning of exit code 0.

Tested locally against live endpoints. A 429-only run passes with a warning after two 10-second waits. A run that also includes a 404 still fails, and the Entur URL from PR 951 returns 200.

This re-submits b45e7e0 for review. That commit reached master by direct push and was reverted in #953.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@fredericsimard fredericsimard self-assigned this Nov 3, 2026

@richfab richfab left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM functionally.
I'll let you do the merge @fredericsimard.
Thank you

@fredericsimard
fredericsimard merged commit 4567341 into master Nov 4, 2026
4 checks passed
@fredericsimard
fredericsimard deleted the fix/check-new-urls-retry-after-v2/2026-11-03 branch November 4, 2026 14:08
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.

2 participants