-
Notifications
You must be signed in to change notification settings - Fork 9.8k
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
server stops listen watch stream requests if watch is not permitted #11708
Comments
Reading form the code, the code execution blocks until either of the following 2 things happen before
|
Yes, exactly. Thank you! Imo,
there should be
The later code is from the similar part of the same loop |
I see. Your explanation make sense to me. Let me reproduce this issue locally and send a fix. |
@dkabracadabra, I just sent a PR(#11754) that may fix your issue. Just out of curiosity, could you please share your use cases where this issue happens? I find it hard to reproduce. We used to encounter a similar problem as this one, that in some rare cases the watch request will hang forever, and we worked around this by not leveraging the etcd auth feature (it's a pity we didn't dig further). |
@polyrabbit thank you!
The lib has a related issue issue that I patched first and then faced the issue with watchstream. All 3 nodes should execute a task on some event, but only one at a time. The lib lacks native election and lock features of etcd. So basically it is like the following:
The issue was highly reproducible to me. ~50% |
Ah! it makes sense - you are not using the official Go client, the official one has some protection against the broken stream. Thus it's hard to reproduce on my end. Thanks for sharing! @dkabracadabra |
I know almost nothing about golang but i think there's a mistake/typo in server's watch stream recieve loop.
This line should be one line upper, inside
case <-sws.closec:
branch. Looks like currently if watch is not permitted then server just exits recieve loop and silently stops responding requests on watch stream. At least it is what I saw on client side.The text was updated successfully, but these errors were encountered: