Repository navigation
fix(faucet): start a redelivery gap where the read it stands for stops - #36
Merged
Merged
Conversation
GitHub writes an attempt down when it ends, so a failure can be listed a few seconds below the position of the run before. A read reaches RedeliveryReadOverlap below that position, but the gap that stands for an unread read starts at the position itself. A late failure in that overlap that no run reads before GitHub deletes it ends in neither a read nor a gap. The new tests list a failure L 3 seconds below the position A, after the run that read A, and check that L ends tracked, stored or inside a logged gap. Each case reaches one of the three places where a gap replaces a read: - the head reads to the end of the list after a cron outage longer than GitHub's retention; - a range left open by a burst expires unread; - a range is read to the end of the list after GitHub deleted L. All three fail on main. requireNoSilentLoss now prints the logged gaps, so a failure shows how far above L each gap starts.
A read of the head or of a range stops RedeliveryReadOverlap below its old end, because GitHub lists an attempt that ended late below one that ended earlier. The gap that a run records in place of that read started at the old end, so a late failure in the overlap that GitHub deleted before any run read it ended in neither a read nor a gap. The three gaps that stand for a read now start at the read's bound: - the head's gap when it reads to the end of the list; - the gap of a range that expires unread; - the gap of a range that is read to the end of the list. The first run's before-tracking gap keeps its start, because that read has no overlap. The gaps that a hook change closes in the stores keep theirs too. TestRedeliverRecordsOnlyTheExpiredPartOfARangeAsAGap now expects the gap to start the overlap below the earlier position. The Redeliver doc comment and the README's `gap` state say that a gap holds the overlap.
--- _Generated with [`xum`](https://github.com/coder/xum) • Model: `anthropic:claude-opus-5-5` • Thinking: `high`_
ThomasK33
added a commit
that referenced
this pull request
Nov 16, 2026
…d above it Since #36 the gap of a range that closes unread starts at OlderAt - O, but it still ended at max(NewerAt, OlderAt). A range whose NewerAt lay inside the overlap below OlderAt then logged a gap up to 3 minutes above the oldest attempt that a run had read. UnreadGap now ends at max(NewerAt, OlderAt - O), rule 8's [OlderAt - O, NewerAt], for the expired ranges and the ranges of a changed hook. The #36 test "the range expires unread" closes its range by reading it, because its one run after the outage still has the Date from before it. A new test closes a range in the run after that, without a page for it, and checks both ends of its gap.
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.
Why
The redelivery sweep promises that every failed delivery ends recovered, given up, or inside a counted gap. A gap starts at the old position, but the read it stands for goes 5 minutes lower, to catch attempts that GitHub writes late. A late failure listed in those 5 minutes ends in neither a read nor a gap. This fix needs no clock change, so it ships ahead of the #26 redesign.
What changed
RedeliveryReadOverlap. This applies in three places: the head after a long cron outage, a range that expires unread, and a range read to the end of the list.faucet/redeliver_gaps_test.gocover each place. The first commit adds them, and they fail on main.gapentry says that a gap includes the overlap.Scope
Blast Radius
Gaps get 5 minutes wider at their old end. A quiet hook logs its gap after a cron outage of 71h55m instead of 72h. A range opened by the first run can overlap the first run's gap by 5 minutes. Gaps can overlap, and no code assumes that they do not. These two effects come from reading the code. No test covers them.
Verification
go test -race ./...passes.go vetpasses, andgolangci-lintreports 0 issues.verify/: 234 of 234 passed.Refs #26
Generated with
xum• Model:anthropic:claude-opus-5-5• Thinking:high