Repository navigation
fix(http): bound coalesced reads and make throttle and token states explicit - #204
Merged
Merged
Conversation
…xplicit - Coalesced registry and derived reads kept every response body for the life of the process. Each entry now lives only while a caller holds it, removed on every exit path including cancellation. - Docker Hub 429s are classified once into an explicit Throttle. A bare HEAD or tag-list 429 is an ordinary throttle, not a six-hour host block. - A 401 on an account-credentialed registry request no longer deletes the shared anonymous token row: only anonymous scopes have a persisted key. - The GitHub governor keeps a spent bucket's reset monotone, so a response in flight can't shorten a rate-limit wait. - OSV advisory paging fails on a repeated page token or after 100 pages. - The release catalog's head says whether it is a reusable first page, instead of inferring it from the page size. - One Fences type tracks code fences for every release-notes reader, so changelog sections agree with sanitising about fences in lists and quotes. - cache_hits counts answers taken from the cache, not every revalidation.
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
count-patchula | f7b397b | Commit Preview URL Branch Preview URL |
Nov 08 2026, 08:08 PM |
…counter Review findings on #204: - The shared fence tracker opened fences inside block quotes and list items but only a fence line closed them, so an unclosed fence in a quote swallowed every later changelog version. A fence now records its container and ends with it, and only a fence line in the same container closes it, as in CommonMark. - A Docker Hub counter written `00` was read as non-zero by one check and zero by the other; both now parse it as a number.
Second-pass review findings on #204: - `fit` closed a cut fence with a bare delimiter. For a fence inside a quote or list item that line ended the container and opened a new document-level fence, so everything after it rendered as code. The closer now carries the fence's quote markers and list indentation. - Leading tabs counted as no indentation, so a tab-indented line ended a list item's fence early; a tab now reaches the next multiple of four. - The cut-point check used its own fence detector; it now asks Fences, and the old helper is gone.
A tab between a list marker and a fence counted as one column, so the closer `fit` writes landed outside the list item on GitHub and opened a new fence. The content column now counts tabs to the next tab stop.
Merged
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.
First of several PRs that replace implicit state machines with explicit ones.
Changes
derived_readskept the last fullResponsefor every registry and derived read key, and the engine (with its HTTP client) lives across server batches. Each entry now lives only while a caller holds a lease on it, and is removed on drop, cancellation included. This is a plausible contributor to one failing repository retries the whole batch every minute, and memory grows until OOMKill #193's growth, but not a confirmed one.Throttle(Pulls,Host,Retry). Only manifest GETs use the pull counter, so a bare HEAD or tag-list 429 is now an ordinary throttle instead of a six-hour block onregistry-1.docker.io.live).Head::Page/Head::Newestreplaces thecount == 100test that decided whether the head page could be reused.Fencestype tracks code fences for changelog parsing, sanitising, heading demotion and block closing. The changelog parser used to miss fences inside list items and block quotes.cache_hitsnow counts answers taken from the cache (fresh, stale on 429, or 304), matching the GitHub side. It no longer counts every revalidation.Cached's unnamed bool is nowrevalidating. The one-wayreaders_validlatch is documented: it is deliberate, because readers keep the moved-aside file open.Looked at, no change
digest:{tag}stale key: these work as intended.from_chartflag with empty sections: rendering already handles it.Tests
New tests cover lease cleanup (finished and cancelled callers), the bare HEAD 429, the monotone governor reset, and fences inside lists and quotes. The
patchula-http,patchula-githubandpatchula-datasourcesuites pass.