Repository navigation
Never leave a claimed slot marked and unsent - #6
Merged
Merged
Conversation
A clock claims a slot's mark, then reads the ledger, then sends. Two paths left the mark in place with nothing sent, so every later tick read the slot as sent and only GitHub's backstop delivered it, late: - The ledger read after the claim failed. It now releases the mark, as a failed send already did. - The claim's create applied but GitHub answered otherwise. gh_api retries a POST whose answer was lost, and the retry is told the ref exists, so the clock took its own mark for another clock's; or the lost answer was the last attempt's, and the claim failed with the mark in place. Each claim's note now carries a random id, so its blob is that claim's alone, and a claim that is refused or fails reads the mark and holds it when the mark points at its own blob. The live check claims the same mark twice with one id, which is what a retried create that applied looks like, and confirms the claim holds it: that rests on the note hashing to the blob GitHub made.
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.
A clock claims a slot's mark, reads the ledger, then sends. In v0.2.0, two paths can leave the mark in place with nothing sent. Every later tick then reads the slot as sent, and only GitHub's backstop delivers it, late. It's one slot per failure, since the next slot has a mark of its own.
The ledger read after the claim fails. It now releases the mark, the same way a failed send already did.
The claim's create lands, but GitHub answers otherwise.
gh_apiretries a POST whose answer was lost, so:Each claim's note now carries a random id, so its blob is that claim's alone. A claim that is refused or fails reads the mark, and holds it when the mark points at its own blob.
What's still not covered: a clock that can neither create nor read the mark, or one stopped between its claim and its send. Either way GitHub's backstop delivers the slot late, as the README says.
Tests:
Run from a Mac against this repository: unit tests on Python 3.14 and 3.10, and the full live check with
--require-clock-check.The version goes to 0.2.1.