Skip to content

Log when an HTTP error disables GitHub Actions caching - #1517

Open
kwy404 wants to merge 3 commits into
google:mainfrom
kwy404:fix-cache-http-error-log
Open

kwy404 wants to merge 3 commits into
google:mainfrom
kwy404:fix-cache-http-error-log

Conversation

@kwy404

@kwy404 kwy404 commented Sep 25, 2026

Copy link
Copy Markdown

When the GitHub Actions cache service returns a non-2xx status, #maybeHandleServiceDown sets #serviceIsDown = true and then starts an async task that reads the response body and logs why caching was disabled (rate limit, 503, or another HTTP error). That task first checks if (this.#serviceIsDown) return;, but the flag was set just before, so it always returns and the message is never logged. Network errors take the synchronous branch and are logged fine; only HTTP errors are silent.

The concurrent-request dedup is already handled by the synchronous #serviceIsDown check above, so this removes the extra check inside the async task.

Added a test in cache-github-fake.test.ts that forces a 503 on the first cache lookup and checks that the simple logger prints the "temporarily unavailable" message. It fails before the change and passes after. Also added a CHANGELOG entry under Unreleased > Fixed.

Related to #1330, where the expected behavior was to disable caching for the rest of the run and warn.

@aomarks aomarks left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks, looks like this was a regression. I also added a commit to this PR which fixes a related thing that turned up, we were trying to show the error body, but were not.

@kwy404

kwy404 commented Sep 25, 2026

Copy link
Copy Markdown
Author

Thanks for the review and for the follow up fix!

@kwy404

kwy404 commented Oct 3, 2026

Copy link
Copy Markdown
Author

Hi @aomarks, friendly ping: this is approved and green. Is there anything else you need from me before it can be merged?

This branch has not been deployed

No deployments
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