Repository navigation
Sharing one PublicRandStream per chain between next callers - #31
Merged
Merged
Conversation
The node keys its streams by peer address, so each Next call opening its own stream evicted the previous caller's one.
A stream that stays silent for two periods is cancelled, so the next caller reopens it through the picker.
Reopens after a failure alternate SkipCtxKey so the picker leaves the node that failed. A stall reopens the stream without failing the callers waiting on it.
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.
The node keys its streams by peer address, so each
nextrequest opening its own stream over our shared conn was evicting the previous caller's one, which then got a 500. We now keep a single stream per chain in theClientand fan out its beacons to all the waitingNextcallers.Also, a stream that stays silent for two periods gets reopened, alternating
SkipCtxKeyso we move off a node that stopped emitting, without failing the callers waiting on it. Notice it only alternates between the two preferred nodes, a third one is never reached since that's how the picker works.Fixes drand/drand-infra#240