import com.google.common.annotations.Beta;
import com.google.common.base.Preconditions;
+import com.google.common.base.Stopwatch;
import com.google.common.base.Verify;
import java.util.Collection;
import java.util.Map;
return this;
} else if (conn != null) {
LOG.info("{}: connection {} indicated no leadership, reconnecting it", persistenceId(), conn, cause);
- return conn.reconnect(this);
+ return conn.reconnect(this, cause);
}
}
if (cause instanceof OutOfSequenceEnvelopeException) {
} else if (conn != null) {
LOG.info("{}: connection {} indicated no sequencing mismatch on {} sequence {}, reconnecting it",
persistenceId(), conn, failure.getTarget(), failure.getSequence(), cause);
- return conn.reconnect(this);
+ return conn.reconnect(this, cause);
}
}
LOG.info("{}: resolved shard {} to {}", persistenceId(), shard, backend);
final long stamp = connectionsLock.writeLock();
try {
+ final Stopwatch sw = Stopwatch.createStarted();
+
// Create a new connected connection
final ConnectedClientConnection<T> newConn = new ConnectedClientConnection<>(conn.context(),
conn.cookie(), backend);
LOG.warn("{}: old connection {} does not match existing {}, new connection {} in limbo",
persistenceId(), conn, existing, newConn);
} else {
- LOG.info("{}: replaced connection {} with {}", persistenceId(), conn, newConn);
+ LOG.info("{}: replaced connection {} with {} in {}", persistenceId(), conn, newConn, sw);
}
} finally {
connectionsLock.unlockWrite(stamp);