Repository navigation
fix(fetch): Undo the claim when submitting to the push pool fails (v2) - #800
Merged
Merged
Conversation
Co-Authored-By: Claude <noreply@anthropic.com>
evanh
approved these changes
Sep 28, 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.
Description
When the fetch thread claims an activation but cannot hand it to the push pool, the row is left in the Claimed state with nothing holding it. The claim query only selects Pending rows, so nothing re-picks it and it sits until handle_claim_expiration reverts it.
This inflates the SLO metric. pending_activation.max_lag.sec counts Claimed rows, so one stranded activation drives it up until the lease expires. This symptom can be observed consistently in process-segments-push in s4s2: DD link. During this time, throughput, occupancy and AlloyDB latency were all normal, so the metric was tracking a single stuck row rather than real pipeline latency.
When workers briefly go unavailable (due to a deployment), failed pushes each revert their own claim, which is correct, but the retried work fills the push queue to its cap. Activations that then time out submitting to the push queue are not reverted. The fetch thread only logs them.
Fix
Release the claim when a submit to the push pool fails, for both Timeout and Closed.
This is safe because only activations that never left the broker are released, so no worker can be running them. A submit failure now costs roughly the fetch backoff instead of the full claim lease. The push thread already reverted inline after a failed gRPC push. That logic moved to ActivationStore::undo_claims, so the push thread gets the same fenced release.
🤖 Generated with Claude Code