@xetorthio You're right.
In fact, whether Pool's implementation changed to synchronized or not, your situation could be occurred.
(Getting Jedis instance before failover, and returning instance after failover)

Difference is just we could catch some noise between race condition. (solves getResource() problem)

Maybe we need to find ways to free to get / return with no annoying whether internal pool instance is changed or not.
(Maybe I feel annoying when we return instance, but pool is complaining it's old thing, and throwing Exception.)

In returnObject(), for example, I think we could make your situation pass to catching IllegalStateException and does nothing, but I cannot decide it's right solution, and I've not tried yet.
I wish to know your / our thought. (opinion or solution or etc, all of thoughts are welcome.)

http://commons.apache.org/proper/commons-pool/xref/org/apache/commons/pool2/impl/GenericObjectPool.html

````
@Override
public void returnObject(T obj) {
    PooledObject<T> p = allObjects.get(obj);

    if (!isAbandonedConfig()) {
        if (p == null) {
            throw new IllegalStateException(
                    "Returned object not currently part of this pool");
        }
    } else {
        if (p == null) {
            return;  // Object was abandoned and removed
        } else {
            // Make sure object is not being reclaimed
            synchronized(p) {
                final PooledObjectState state = p.getState();
                if (state == PooledObjectState.ABANDONED ||
                        state == PooledObjectState.INVALID) {
                    return;
                } else {
                    p.markReturning(); // Keep from being marked abandoned
                }
            }
        }
    }

		...
````

````
@Override
public void invalidateObject(T obj) throws Exception {
    PooledObject<T> p = allObjects.get(obj);
    if (p == null) {
        if (isAbandonedConfig()) {
            return;
        } else {
            throw new IllegalStateException(
                    "Invalidated object not currently part of this pool");
        }
    }
    ...
````