VOK-139 Relay task claims can strand deliveries after route ownership changes#148
Open
vkforeman[bot] wants to merge 1 commit into
Open
VOK-139 Relay task claims can strand deliveries after route ownership changes#148vkforeman[bot] wants to merge 1 commit into
vkforeman[bot] wants to merge 1 commit into
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
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.
Request
Prompt context:
<title>Relay task claims can strand deliveries after route ownership changes</title> ## ProblemCommit
34c68f8595fba84407529542ade3a0d97b6d221a(Prevent duplicate proxy task pulls, April 24, 2026) introduces durablerelay_task_claimsownership for a(owner_user_id, provider, claim_key)tuple, but the route-claim replacement path never clears or reassigns that ownership when a node stops claiming the route.As a result, a task identity can stay pinned to a node that no longer owns the route. New deliveries for the replacement node are inserted, but they are filtered out during leasing because
relay_task_claim_allows_nodestill points at the old node id.Concrete repo evidence
/Users/lemi/code/foreman/foreman-proxy/src/db/relay.rsrelay_task_claimsrow on first lease and then permanently gate future leases on the storedclaimed_node_idmatching the current node.claimed_node_iddiffers, lines 406-407 returnfalse, which skips leasing entirely for the new node./Users/lemi/code/foreman/foreman-proxy/src/db/nodes.rsnode_route_claimsfor a node before writing the replacement set.relay_task_claims, so historical task ownership survives even when the node drops the route./Users/lemi/code/foreman/foreman-proxy/src/api/tests.rsclaim_keystays attached to the first claimant for subsequent deliveries.Why this is a bug
The new claim table is intended to suppress duplicate task pulls, but without any cleanup or reassignment hook it can outlive the routing truth in
node_route_claims. Once that happens, deliveries for the surviving route owner remain pending forever because no current claimant is allowed to lease them.Minimal safe fix
relay_task_claimsentries that point at a node whenreplace_node_route_claimsremoves the corresponding route from that node.Duplicate check
Searched Linear for
route claims,relay task claims,relay claim, and related Foreman bug terms; no duplicate issue was returned.Bug
Linear issue VOK-139: Relay task claims can strand deliveries after route ownership changes
Issue URL: https://linear.app/vokality/issue/VOK-139/relay-task-claims-can-strand-deliveries-after-route-ownership-changes
Team: Vokality
State: Todo
Labels: Bug
Problem
Commit
34c68f8595fba84407529542ade3a0d97b6d221a(Prevent duplicate proxy task pulls, April 24, 2026) introduces durablerelay_task_claimsownership for a(owner_user_id, provider, claim_key)tuple, but the route-claim replacement path never clears or reassigns that ownership when a node stops claiming the route.As a result, a task identity can stay pinned to a node that no longer owns the route. New deliveries for the replacement node are inserted, but they are filtered out during leasing because
relay_task_claim_allows_nodestill points at the old node id.Concrete repo evidence
/Users/lemi/code/foreman/foreman-proxy/src/db/relay.rsrelay_task_claimsrow on first lease and then permanently gate future leases on the storedclaimed_node_idmatching the current node.claimed_node_iddiffers, lines 406-407 returnfalse, which skips leasing entirely for the new node./Users/lemi/code/foreman/foreman-proxy/src/db/nodes.rsnode_route_claimsfor a node before writing the replacement set.relay_task_claims, so historical task ownership survives even when the node drops the route./Users/lemi/code/foreman/foreman-proxy/src/api/tests.rsclaim_keystays attached to the first claimant for subsequent deliveries.Why this is a bug
The new claim table is intended to suppress duplicate task pulls, but without any cleanup or reassignment hook it can outlive the routing truth in
node_route_claims. Once that happens, deliveries for the surviving route owner remain pending forever because no current claimant is allowed to lease them.Minimal safe fix
relay_task_claimsentries that point at a node whenreplace_node_route_claimsremoves the corresponding route from that node.Duplicate check
Searched Linear for
route claims,relay task claims,relay claim, and related Foreman bug terms; no duplicate issue was returned.Session comment:
This thread is for an agent session with foreman.
Summary
Cleared stale relay task claims on route replacement and added route-handoff regressions
Checks
foreman-server-format: passed (exit status 0)foreman-server-checks: passed (exit status 0)foreman-server-tests: passed (exit status 0)Foreman Metadata
019dc1c9-04ba-7263-954e-b81e56094cc9019dc1ca-f73f-79b2-bfde-eb2f42361108019dc1ca-f614-7c63-b280-a0510ffde8341lb/foreman/019dc1c9-04ba-7263-954e-b81e56094cc9