feat: retry coordinator-to-worker channel setup + fix 2 bugs - #712
Open
gabotechs wants to merge 4 commits into
Open
feat: retry coordinator-to-worker channel setup + fix 2 bugs#712gabotechs wants to merge 4 commits into
gabotechs wants to merge 4 commits into
Conversation
gabotechs
commented
Sep 7, 2026
Comment on lines
+83
to
+95
| // https://grpc.io/docs/guides/status-codes/#deadline-exceeded | ||
| // The worker may be slow or wedged, so retry a different URL. | ||
| Code::DeadlineExceeded => RetryOutcome::OtherUrl.tag(err), | ||
| // https://grpc.io/docs/guides/status-codes/#resource-exhausted | ||
| // Admission pressure is local to this worker, so retry a different URL. | ||
| Code::ResourceExhausted => RetryOutcome::OtherUrl.tag(err), | ||
| // https://grpc.io/docs/guides/status-codes/#aborted | ||
| // Routing retries this task setup at the higher level on the same URL. | ||
| Code::Aborted => RetryOutcome::SameUrl.tag(err), | ||
| // https://grpc.io/docs/guides/status-codes/#unavailable | ||
| // This is a transient failure; retry the task setup on the same URL. | ||
| Code::Unavailable => RetryOutcome::SameUrl.tag(err), | ||
| Code::Ok => err, |
Collaborator
Author
There was a problem hiding this comment.
tbh, I don't know what I'm doing here... there's probably a better retry policy for this.
Invoking @hermeGarcia, in the hopes that you have better suggestions about how to transparently handle retries here.
Comment on lines
59
to
61
| self.tx.send_modify(|v| { | ||
| if v.is_none() { | ||
| if v.is_none() || !*read_started { | ||
| *v = Some(item); |
Collaborator
Author
There was a problem hiding this comment.
Fix for bug 1: if nobody has read yet the value, we are good to replace it.
Comment on lines
-24
to
+27
| /// - Lazy inits connections to a remote worker on first call to [WorkerConnectionPool::execute]. | ||
| /// - Lazily initializes connections per remote worker and requested partition range. | ||
| pub(crate) struct WorkerConnectionPool { | ||
| lazy_stream_groups: Vec<OnceLock<SharedBoxFuture<StreamGroup>>>, | ||
| lazy_stream_groups: Vec<DashMap<Range<usize>, SharedBoxFuture<StreamGroup>>>, |
Collaborator
Author
There was a problem hiding this comment.
Fix for bug 2: if two requests come for the same target task, we still need to discriminate between requested partition ranges.
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.
Builds on top of
And adds 4 individual commits:
SingleWriteMultipleReadstruct fail on the second write. With this change, the second write just overrides the previous one.WorkerConnectionPool, where retrieving two different non-overlapping ranges of partitions will go through the same cached stream, trying to consume it multiple times.