Repository navigation
fix(registry): stop a KV outage 500ing every /gh page - #40
Merged
Merged
Conversation
The gone-skill middleware read its key set with a bare
`useStorage('cache').getItem`, so `KV GET failed: 500 Internal Server
Error` travelled out of the read-through cache and failed the request
(Sentry SKILLD-S). The D1 fallback behind it could fail the same way.
`resolveGoneSkillKeys` answers null when neither store can be reached,
and the middleware leaves the response status alone. A middleware whose
only job is upgrading 200 to 410 should never be why a page fails.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
❓ Type of change
📚 Description
Sentry check-in of the
skilldproject. Seven of the eight open issues were already closed by earlier commits; this is the one gap left.skill-source-gonemiddleware runs on every/ghrequest and read its key set with a bareuseStorage('cache').getItem. Workers KV answered one of those with:acbd24cmoved theskill-relatedreads ontoreadCache, but this one was on the same request and stayed bare. The D1 fallback under it could fail the same way, and did elsewhere asD1_RESET_DO.resolveGoneSkillKeysnow returnsstring[] | nulland the middleware only sets 410 on a resolved set. The cost of an unresolved lookup is one stale 200 on a deleted skill until the next request. The cost of the old behaviour was the page.One thing I went back and forth on: during a KV outage the fallback puts a D1 query back on the hot
/ghpath, which is the thing the cache is there to prevent. It is capped by the same failure that caused it, and 410-vs-200 is not worth a second cache layer, so I left it.