Skip to content

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

Closed

Description

@beneo

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()
}

Activity

  1. mradzinski commented on Jan 22, 2016

    @mradzinski

    Same issue over here

  2. woxiaobao commented on Nov 24, 2016

    @woxiaobao

    grails-3.1.10 Same issue over here

  3. meltzow commented on Dec 12, 2016

    @meltzow

    Same here in grails 3.2.3

  4. ctoestreich commented on Dec 12, 2016

    @ctoestreich
    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions