-
Notifications
You must be signed in to change notification settings - Fork 92
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
MaxConns for Pool #4
Comments
I'm sorry it's taken so long to respond, for some reason github decided I shouldn't receive notifications for issues on the repo >_< As to your issue: to my knowledge there's no way to block on a channel based on its current size. I'm not even certain the length of a channel could be checked in a thread-safe way without use of a lock or another channel. One possible alternative would be to make it possible for I'm not necessarily opposed to the idea, but I don't believe it will be a straightforward fix by any means. Could you perhaps expand on why this behavior is valuable to you? I personally have never desired it nor have anyone I've worked with or talked to, so I'm curious where you're coming from. |
Yeah, I definitely understand the limitations of channels (as they stand) The major use-case here is when using hosted Redis instances (Heroku, The current behavior—trying to create new connections above the bounds and
|
I think for that use-case even having a limit on the pool size is really just moving the goal-post. Either way there is some kind of limit on number of connections to redis that your are hitting and which is interrupting normal program flow in one way or another. I think for this case it would be better to investigate why you're hitting these limits at all, and trying to prevent it (either on the application side, or with redis cluster). Sorry it's kind of a glib and non-helpful answer, just giving my perspective. As a stop-gap solution it would be pretty straightforward to write a wrapper around |
Thanks—note that I'm not hitting the limit, and obviously the response The best approach is looking like catching the error and retrying 1-2 times On Fri, Sep 18, 2015 at 1:25 AM Brian Picciano notifications@github.com
|
I'll think about if there might be a cleaner way to do this, but for now I think the wrapper is the way to go. I'm gonna go ahead and close this, feel free to reopen if you have any other ideas or further problems :) |
Pool currently provides a
size
parameter that sets an upper limit on the number of idle connections, but doesn't appear to set upper bounds on the number of connections that might be dialled underpool.Get
.Redis will bounce connections above its connection limit, although from what I can discern
p.df(p.Network, p.Addr)
won't timeout (by default) and therefore will block until it connects.It might be worthwhile instead blocking locally until the available connections in the pool are < max rather than attempting to open new ones over the limit.
The text was updated successfully, but these errors were encountered: