-
Notifications
You must be signed in to change notification settings - Fork 24
feat: add allocation reconciliation #882
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
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
Add a background task that periodically triggers allocation
reconciliation to ensure recovery after subgraph connectivity issues.
Previously, the allocation watcher was purely event-driven
and only fired when the allocation list changed. If allocations were
closed during a connectivity outage and the list became static afterward,
no messages would fire and stale SenderAllocation actors would keep
running, never triggering mark_rav_last().
This change adds:
- New config option
(default: 5 min)
- ReconcileAllocations message type for SenderAccount
- Periodic task that sends ReconcileAllocations every
interval
- Handler that forces re-check of all allocations against
the watcher
This ensures closed allocations are detected and RAVs are
properly marked
as 'last' for redemption, even after connectivity issues.
Contributor
Pull Request Test Coverage Report for Build 19845165736Details
💛 - Coveralls |
neithanmo
previously approved these changes
Dec 2, 2025
Collaborator
neithanmo
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is nice!
It is safe to have an extra check
- Add unit test for ReconcileAllocations message handling that verifies
it triggers UpdateAllocationIds with current allocations from watcher
- Add config validation for allocation_reconciliation_interval_secs:
error if 0, warn if < 60s
- Add test for periodic task lifecycle verifying task spawn/abort
- Update create_sender_account() test helper to expose
indexer_allocations_tx and configurable reconciliation interval
- Add tokio test-util feature for time control in tests
…ciliation - Add ALLOCATION_RECONCILIATION_RUNS counter metric - Elevate reconciliation logs from debug to info - Enhance config documentation explaining the connectivity failure scenario
7a82a10 to
7983f8f
Compare
neithanmo
approved these changes
Dec 2, 2025
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.
Adds periodic allocation reconciliation to the TAP agent to ensure reliable RAV finalization after network subgraph connectivity issues.
Previously, the allocation watcher was purely event-driven--if allocations closed during a connectivity outage and the list became static afterward, stale SenderAllocation actors would keep running indefinitely, never triggering
mark_rav_last()for redemption.This change introduces a configurable background task (default: 5 minutes) that periodically forces a re-check of all allocations against the current watcher state, ensuring closed allocations are detected and RAVs are properly marked as 'last' even after missed closure events.
Includes config validation (error if interval is 0, warning if < 60s), comprehensive test coverage, and observability improvements with a new
tap_allocation_reconciliation_runs_totalPrometheus counter and info-level logging.Signed off by Joseph Livesey joseph@semiotic.ai