Skip to content

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

@beneo

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

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