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

clientv3: handle watchGrpcStream shutdown if prior to goroutine start #6142

Merged
merged 1 commit into from
Aug 10, 2016

Conversation

heyitsanthony
Copy link
Contributor

Fixes #6141

Burned the clientv3 Watch tests on my machine for a while just to be sure it's stable.

@@ -268,6 +268,13 @@ func (w *watcher) Watch(ctx context.Context, key string, opts ...OpOption) Watch
case reqc <- wr:
ok = true
case <-wr.ctx.Done():
// tear down stream if this request is the only one using it
wgs.mu.Lock()
if len(wgs.streams) == 0 && wgs.stopc != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

can we make this a method on wgs? I remember we did the same thing in wsg.closestream?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok added wgs.stopIfEmpty()

@xiang90
Copy link
Contributor

xiang90 commented Aug 10, 2016

lgtm

@heyitsanthony heyitsanthony merged commit 81f5e31 into etcd-io:master Aug 10, 2016
@heyitsanthony heyitsanthony deleted the fix-cancel-watch-imm branch August 10, 2016 16:46
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