Skip to content

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

Merged
xiang90 merged 1 commit intoetcd-io:masterfrom
xiang90:sl
May 13, 2016
Merged

*: cancel required leader streams when memeber lost its leader#5332
xiang90 merged 1 commit intoetcd-io:masterfrom
xiang90:sl

Conversation

@xiang90
Copy link
Copy Markdown
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
Comment thread etcdserver/api/v3rpc/interceptor.go Outdated
// 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
Copy Markdown

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
Copy Markdown
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
Copy Markdown
Contributor

gyuho commented May 12, 2016

LGTM. Defer to @heyitsanthony

Thanks.

Comment thread etcdserver/api/v3rpc/watch.go Outdated
id := sws.watchStream.Watch(creq.Key, creq.RangeEnd, rev)
if id != -1 && creq.ProgressNotify {
sws.progress[id] = true
go func() {
Copy link
Copy Markdown

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
Copy Markdown
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
Copy Markdown

overall looks ok

@xiang90
Copy link
Copy Markdown
Contributor Author

xiang90 commented May 13, 2016

@heyitsanthony All fixed. PTAL.

@heyitsanthony
Copy link
Copy Markdown

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