Repository navigation
lore-transport: a call answered as unavailable retries a bounded number of times - #4
Open
TechArtistG wants to merge 1 commit into
Open
TechArtistG wants to merge 1 commit into
TechArtistG wants to merge 1 commit into
Conversation
…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>
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.
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
UNAVAILABLEorUNKNOWNis 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 answeringUNAVAILABLEwas called without limit or pause (GenRobo/GRID#3624).Each call now waits before it retries, 250 ms doubling to 4 s, and fails as
Disconnectedafter 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 onlyBranchPush.lore push, everyBranchPushanswer replacedUNAVAILABLEUNKNOWNIn 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 pushagain reportsalready 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 callUNAVAILABLE, thenUNKNOWN; the client makes 7 calls and gives up. 1 passed.cargo clippy -p lore-transport --all-targets -- -D warningsis clean. The table is a live run: a real loreserver, a proxy that letsBranchPushfinish 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.