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

Why clear timeout when read a response from server? #47

Open
opriz opened this issue Jan 19, 2021 · 3 comments
Open

Why clear timeout when read a response from server? #47

opriz opened this issue Jan 19, 2021 · 3 comments
Labels
needs investigatation Need to dig into root cause
Milestone

Comments

@opriz
Copy link

opriz commented Jan 19, 2021

I found this line in conn.go

https://github.com/samuel/go-zookeeper/blob/master/zk/conn.go#L717
or
https://github.com/go-zookeeper/zk/blob/master/conn.go#L654
c.conn.SetReadDeadline(time.Time{})

In my view, if there occurs a problem in the network or server, clear the timeout deadline may cause this goroutine stuck for a long time even forever.

I wonder why it was written like this, was there some reason I've missed it?
If necessary, I'd like to post an mr.

@blizard863
Copy link

+1

@nemith
Copy link

nemith commented Mar 4, 2021

Good question. I can only think it's to try to leave the connection open between operations, but the people maintaining this fork didn't write that code. If it can be safely removed, a PR is welcome but we should make sure that nothing breaks.

@nemith nemith added bug Something isn't working needs investigatation Need to dig into root cause and removed bug Something isn't working labels Mar 26, 2021
@nemith
Copy link

nemith commented Mar 26, 2021

Need to reproduce an issue (hopefully with a test case) and fix this.

@nemith nemith added this to the v1.1.0 milestone Mar 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs investigatation Need to dig into root cause
Projects
None yet
Development

No branches or pull requests

3 participants