Repository navigation
fix(reach): bound queued cold-report leaders to eight - #566
Merged
Merged
Conversation
Collaborator
Review — CS-Macmini PR#566 — head e9bacf2Dom: APPROVE med nits Fund-tabel
No correctness, concurrency, or scope-boundary defects found. Svar på review-punkterne
Tests og mutanter
Hvad jeg ikke har verificeret
|
dborup
marked this pull request as ready for review
October 24, 2026 13:16
This was referenced Oct 24, 2026
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.
Relates to #557
Summary
Reuse the existing queue-admission correction rather than redesigning the Reach limiter:
Retry-After: 2, before allocating a wait timer.Draft only. The independent static review described below completed after PR creation. Auto-merge remains off. No merge, deployment, host configuration or schema change is part of this PR.
Reuse and scope
The buffered-channel admission algorithm and its regression starting point come from the existing correction authored by
n30nex. Attribution is retained in the commit message and here; the adaptation commits use the fork's requesteddborupidentity.Only four files differ from master:
cmd/server/node_reach_cold_limit.gocmd/server/node_reach_cold_limit_test.gocmd/server/node_reach_waiter_cap_test.godocs/api-spec.mdFork-specific adaptations retain the original fixture and assertions, issue pre-existing "everyone succeeds" tests in bounded bursts, bound cleanup waits, prime our separate rank snapshot for the no-queued-DB-work fixture, and add a 64-round cancellation-versus-promotion regression. No frontend, dependency, configuration, workflow or publication/deployment guard changes.
Commits and master synchronization
772b7f48: one logical implementation/test/documentation commit, initially based onff1acc02.e9bacf22: ordinary merge of master5af6129cafter the separate LRU follow-up landed. No rebase, amend or force push.34fcb7d880d363ee7c287c6434cdc9213eabc290.Local validation
Environment: macOS arm64, Go 1.26.3, Node 26 and real cached Chromium. Tests use disposable local fixtures, not staging or production.
-race, including 64 cancellation/promotion races per run-race -count=3, before master synchronizationInitial sandbox-only Go attempts could not bind local fake-server ports. Their logs are retained separately; loopback-capable runs above actually executed those tests.
Verification gaps — not a fully green final-head claim
TargetClosedhandling during browser teardown. After a narrow shim correction, a post-push attempt reused the exact already-built final source artifact and a fresh fixture copy to avoid another Go compilation. That attempt reached the existing per-node Reach suite's outer time limit on the locally stalled host; no new browser success or broad-smoke completion is claimed. The earlier completed stock Reach checks above remain their own evidence. Repository suites were not edited._leaflet_poserrors on both the candidate and pristineff1acc02. The stock rank test already documents that pre-existing teardown issue. A separate extra mouse attempt was intercepted by the fixed navigation; that pointer failure was not runtime-baseline-verified. Neither is silently presented as passing coverage or fixed by this PR.Performance and limits
Admission is O(1), with one fixed eight-entry buffered channel per limiter. Once initialized, a full queue rejects with zero allocations, enforced by
testing.AllocsPerRun; rejected overflow does not allocate another wait timer. Tests pin two active builds, eight admitted waiters, admission reuse and unchanged pool wait count while the controlled leaders are queued.This is not global HTTP/database admission control. Same-key singleflight followers are outside the eight-leader count. Visibility and ranking checks may issue SQL outside the cold-build limiter, including on cached responses. No FIFO fairness or throughput/RSS improvement is claimed.
The cap is an internal fixed default, not a new operator setting. Any later configurable cap/customizer exposure needs its own explicit follow-up. The server measurement database remains read-only, and all workflow fork guards are unchanged.
Independent review / CI
A fresh reviewer agent that did not implement the change reviewed exact head
e9bacf22b715fe884d9d127a360c5d9cf1bfc632against base5af6129c4ceb72ccf5cc665b81876762b9330c8aafter draft creation: PASS, no actionable code findings.The reviewer read immutable Git objects, all four changed files, the original correction and the unchanged handler/cache/privacy/rank and frontend retry callers. It confirmed admission before timer allocation, exactly-once admission release on promotion/cancellation/timeout, deferred handler slot release, warm-cache/same-key behavior, retained attribution and the stated test coverage. Whitespace checks were clean.
This was an independent static review. The reviewer did not rerun Go/browser suites or independently certify the test logs. Its PASS does not turn the documented final-head full-suite/browser gaps green and does not authorize ready-marking, merge or deployment.
Automatic PR CI is run
40091412562on the same head. At the final readback, all three Go server shards, the aggregate Go gate, ingestor/library/script/JavaScript checks, Docker image validation and E2E shards 1 and 3 had passed; E2E shard 2 was still running. No workflow was manually rerun or cancelled. Check its actual final conclusion before treating the PR as merge-ready; no final CI success is claimed here.