Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

*: cancel required leader streams when memeber lost its leader #5332

Merged
merged 1 commit into from
May 13, 2016

Conversation

xiang90
Copy link
Contributor

@xiang90 xiang90 commented May 12, 2016

@xiang90 xiang90 force-pushed the sl branch 2 times, most recently from 6e4de5d to de6894e Compare May 12, 2016 19:44
// 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 {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

declare election retry max as a const somewhere?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will do.

@gyuho
Copy link
Contributor

gyuho commented May 12, 2016

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() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can recvLoop stay the same and instead move the errc/goroutine machinery into Watch?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes. i feel this makes the driver func clearer. but i will try the other way.

@heyitsanthony
Copy link
Contributor

overall looks ok

@xiang90
Copy link
Contributor Author

xiang90 commented May 13, 2016

@heyitsanthony All fixed. PTAL.

@heyitsanthony
Copy link
Contributor

lgtm

@xiang90 xiang90 merged commit a880e9c into etcd-io:master May 13, 2016
@xiang90 xiang90 deleted the sl branch May 13, 2016 03:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants