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

grpcproxy: reliably track rid in watchergroups #6789

Merged
merged 1 commit into from
Nov 2, 2016

Conversation

heyitsanthony
Copy link
Contributor

Couldn't find watcher group from rid on server stream close, leading to
watcher group sending on a closed channel.

Also got rid of send closing the watcher stream if the buffer is full,
this could lead to a send after close while broadcasting to all receivers.
Instead, if a send times out, have the caller issue a cancel().

Fixes #6739

/cc @xiang90

@@ -63,7 +63,10 @@ func (wg *watcherGroup) broadcast(wr clientv3.WatchResponse) {

wg.rev = wr.Header.Revision
for _, r := range wg.receivers {
r.send(wr)
if !r.send(wr) {
wg.cancel()
Copy link
Contributor

Choose a reason for hiding this comment

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

why do we need to cancel the entire watch group here? we should only cancel that single watcher stream connected to one client, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Mostly an artifact of the wrong information being passed around. Will fix.

@heyitsanthony
Copy link
Contributor Author

all fixed /cc @xiang90

Couldn't find watcher group from rid on server stream close, leading to
the watcher group sending on a closed channel.

Also got rid of send closing the watcher stream if the buffer is full,
this could lead to a send after close while broadcasting to all receivers.
Instead, if a send times out then the server stream is canceled.

Fixes etcd-io#6739
@xiang90
Copy link
Contributor

xiang90 commented Nov 2, 2016

LGTM! Thanks.

@heyitsanthony heyitsanthony merged commit 3782571 into etcd-io:master Nov 2, 2016
@heyitsanthony heyitsanthony deleted the grpcproxy-close-send branch November 2, 2016 22:29
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.

grpc-proxy: panic: send on closed channel
2 participants