Skip to content

Fix: Handle 502 Bad Gateway errors gracefully in GitHub Actions cache#1412

Open
jlaportebot wants to merge 1 commit intogoogle:mainfrom
jlaportebot:main
Open

Fix: Handle 502 Bad Gateway errors gracefully in GitHub Actions cache#1412
jlaportebot wants to merge 1 commit intogoogle:mainfrom
jlaportebot:main

Conversation

@jlaportebot
Copy link
Copy Markdown

When GitHub Actions cache service returns a 502 Bad Gateway error, wireit now disables caching for the remainder of the run instead of crashing with an internal error. This makes wireit more robust when the cache service experiences temporary issues.

Fixes #1330

Changes

  • Added 502 (Bad Gateway) to the list of status codes that trigger graceful error handling in method
  • Added a specific error message for 502 errors: "GitHub Actions cache service returned a bad gateway error"

Testing

  • The existing test suite already tests random 5xx errors (including 502) via
  • The fix ensures that when a 502 error occurs, caching is disabled for the remainder of the run instead of crashing
  • This matches the behavior already implemented for 429 (rate limit) and 503 (service unavailable) errors

Impact

  • Users will no longer see internal error crashes when GitHub Actions cache service returns 502 errors
  • Builds will continue to run successfully, just without caching for the remainder of the run
  • This is a non-breaking change that improves robustness

When GitHub Actions cache service returns a 502 Bad Gateway error,
wireit now disables caching for the remainder of the run instead of
crashing with an internal error. This makes wireit more robust when
the cache service experiences temporary issues.

Fixes google#1330
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.

Bug: Internal Error after a 502 HTTP error

1 participant