*: cancel required leader streams when memeber lost its leader#5332
Merged
xiang90 merged 1 commit intoetcd-io:masterfrom May 13, 2016
Merged
*: cancel required leader streams when memeber lost its leader#5332xiang90 merged 1 commit intoetcd-io:masterfrom
xiang90 merged 1 commit intoetcd-io:masterfrom
Conversation
6e4de5d to
de6894e
Compare
| // We are more conservative on canceling existing streams. Reconnecting streams | ||
| // cost much more than just rejecting new requests. So we wait until the member | ||
| // cannot find a leader for 3 election timeouts to cancel existing streams. | ||
| if noLeaderCnt >= 3 { |
There was a problem hiding this comment.
declare election retry max as a const somewhere?
Contributor
|
LGTM. Defer to @heyitsanthony Thanks. |
| id := sws.watchStream.Watch(creq.Key, creq.RangeEnd, rev) | ||
| if id != -1 && creq.ProgressNotify { | ||
| sws.progress[id] = true | ||
| go func() { |
There was a problem hiding this comment.
can recvLoop stay the same and instead move the errc/goroutine machinery into Watch?
Contributor
Author
There was a problem hiding this comment.
yes. i feel this makes the driver func clearer. but i will try the other way.
|
overall looks ok |
Contributor
Author
|
@heyitsanthony All fixed. PTAL. |
|
lgtm |
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.
/cc @heyitsanthony @gyuho