But then I wonder what would happen if I get a resource from the pool, in
the mean time the internal pool changes, and then I want to return it back
to the pool. It will probably fail... these are strange situations that I
don't feel very comfortable with.


On Mon, Jan 27, 2014 at 10:49 AM, Jungtaek Lim <notifications@github.com>wrote:

> In src/main/java/redis/clients/util/Pool.java:
>
> >      }
> >
> >      public T getResource() {
> > -	try {
> > -	    return internalPool.borrowObject();
> > -	} catch (Exception e) {
> > -	    throw new JedisConnectionException(
> > -		    "Could not get a resource from the pool", e);
> > +    synchronized (lock) {
>
> @xetorthio <https://github.com/xetorthio> Yes. If we call getResource()
> while JedisSentinelPool closes internal pool but not yet create new
> internal pool, assertOpen() failed in GenericObjectPool.borrowObject() and
> getResource() throws JedisConnectionException().
> So I modified all methods that uses internalPool to synchronized.
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/xetorthio/jedis/pull/517/files#r9192809>
> .
>