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

redis.clients.jedis.exceptions.JedisConnectionException: Could not get a resource from the pool #53

Open
beneo opened this issue Apr 17, 2015 · 4 comments

Comments

@beneo
Copy link

beneo commented Apr 17, 2015

i got exception

redis.clients.jedis.exceptions.JedisConnectionException: Could not get a resource from the pool

why not release the connect ??

 def withRedis(Closure closure) {
    Jedis redis = redisPool.resource
    try {
        def ret = closure(redis)
        redisPool.returnResource(redis)
        return ret
    } catch(JedisConnectionException jce) {
        redisPool.returnBrokenResource(redis)
        throw jce
    } catch(Exception e) {
        redisPool.returnResource(redis)
        throw e
    }
}

why there is no block with

finally {
    redis.close()
}
@mradzinski
Copy link

Same issue over here

@woxiaobao
Copy link

grails-3.1.10 Same issue over here

@meltzow
Copy link

meltzow commented Dec 12, 2016

Same here in grails 3.2.3

@ctoestreich
Copy link
Contributor

@beneo @mradzinski @woxiaobao @meltzow I have added some new code that should work given the changes to how Jedis releases connections to the pool simply by using the .close() method. Can you guys take a look at 78e7881 and make sure it looks good. I apologize for the whitespace changes it appears that previous authors weren't using IntelliJ with sensible formatting corrections.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants