-
Notifications
You must be signed in to change notification settings - Fork 622
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
Remove check for available streams #158
Conversation
A connection should be pickable even if no streams are currently available. In this case, when executing the query, the connection will block reading from the streams channel [see func (c *Conn) exec(...)] until one is available. This avoids 'unavailable' errors when there are more than numConns*numStreams queries pending.
LGTM nice and simple yet the bug has a big impact. I want to have one more person weigh in on it before we merge. Thanks for fix! |
LGTM. The previous check was very racy anyway. We should probably add a timeout to the receive from the uniq channel to send a signal to the connection manager that more connections might be required. But that's another issue. |
Remove check for available streams
Thanks! |
@miguelvps Many thanks for your contribution. I have also added your name and mail address to the AUTHORS file for copyright purposes. I hope that's OK. |
@tux21b sure! |
The way to solve this will be to have a global semaphore for the cluster but I dont know a good implementation which allows us to change the count dynamically. |
@Zariel Are you saying that there is still a bug here? |
No, but thats just the graceful solution, it works really well when there are a static number of nodes and streams but not with dynamic nodes. |
The check should not be removed. The unavailable call should be handled by a higher level
|
Im not entirely happy with the previous behaviour which would end up spamming out ErrUnavailable as soon as you saturated connections. |
If the connections are saturated then the client should do something about Also there is a possibility that this connection is saturated/has long I believe their is a retry mechanism somewhere
|
Another benefit of the abstracted connection pool. Since gocql with ship
|
Streams are evil :)
|
Haha so I've heard.
|
I agree that ideally this should be solved at the connection pool The removed check still lets more queries than the available streams |
Fix checking if tablets should be used in scyllaConnPicker Pick
A connection should be pickable even if no streams are currently
available. In this case, when executing the query, the connection will
block reading from the streams channel [see func (c *Conn) exec(...)]
until one is available.
This avoids 'unavailable' errors when there are more than
numConns*numStreams queries pending.