Skip to content

lore-transport: a call answered as unavailable retries a bounded number of times - #4

Open
TechArtistG wants to merge 1 commit into
feature/v0.8.14-stress-fixesfrom
fix/bounded-grpc-retry
Open

TechArtistG wants to merge 1 commit into
feature/v0.8.14-stress-fixesfrom
fix/bounded-grpc-retry

Conversation

@TechArtistG

@TechArtistG TechArtistG commented Nov 22, 2026 •

Copy link
Copy Markdown
Collaborator

What changes

GRID uses Lore to share versioned simulation assets. If every reply said the server was unavailable, a publisher could wait indefinitely while Lore kept sending a change the server might already have saved. This PR makes the client wait between attempts and stop after six retries for requests sent this way. A failed upload still does not tell the publisher whether the server saved the change.

A gRPC call that the server or the connection answers UNAVAILABLE or UNKNOWN is retried after a reconnect. Only the first retry of a call reconnected: every later one found the connection already reconnected and sent the call again at once. A server that kept answering UNAVAILABLE was called without limit or pause (GenRobo/GRID#3624).

Each call now waits before it retries, 250 ms doubling to 4 s, and fails as Disconnected after 6 retries, about 12 s. A reconnect that is needed still runs its own attempts inside a retry, so a server that is down for a while is waited for as before. The change covers every gRPC call, not only BranchPush.

lore push, every BranchPush answer replaced v0.8.18 This PR
by UNAVAILABLE 35,240 calls in 90 s, killed 7 calls, exit 6 after 12.2 s
by UNKNOWN 45,330 calls in 90 s, killed 7 calls, exit 6 after 12.3 s

In all four runs the server had applied the push on the first call.

Not changed

A push that fails this way may have been applied: the answer was lost, not the request. The CLI does not say so yet. lore push again reports already pushed and at remote latest, or pushes.

Tests

grpc::call_retry_tests::a_push_answered_unavailable_fails_after_bounded_retries: a loopback tonic server answers every call UNAVAILABLE, then UNKNOWN; the client makes 7 calls and gives up. 1 passed. cargo clippy -p lore-transport --all-targets -- -D warnings is clean. The table is a live run: a real loreserver, a proxy that lets BranchPush finish and replaces its answer.

Not checked: whether the QUIC client's own reconnect loop has the same fault.

Base: v0.8.18 (318f3fd). Independent of the managed-repository PRs.

…er of times

A gRPC call that the server or the connection answers UNAVAILABLE or UNKNOWN
is retried after a reconnect. Only the first retry of a call reconnected:
every later one found the connection already reconnected and sent the call
again at once, so a server that kept answering UNAVAILABLE was called without
limit or pause. `lore push` against such an answer made 35,000 BranchPush
calls in 90 s and never returned, while the server had applied the push on
the first.

Each call now waits before it retries, 250 ms doubling to 4 s, and fails as
Disconnected after 6 retries (about 12 s). A reconnect that is needed still
runs its own attempts inside a retry, so a server that is down for a while is
waited for as before.

A push that fails this way may have been applied: the answer was lost, not
the request. `lore push` again says so ("already pushed and at remote
latest") or pushes.

Refs GenRobo/GRID#3445.

Signed-off-by: Geordie Moffatt <geordie.moffatt@generalrobotics.company>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant