+ if (cause instanceof NotLeaderException) {
+ final AbstractClientConnection<T> conn = getConnection(command);
+ if (conn instanceof ReconnectingClientConnection) {
+ // Already reconnecting, do not churn the logs
+ return this;
+ } else if (conn != null) {
+ LOG.info("{}: connection {} indicated no leadership, reconnecting it", persistenceId(), conn, cause);
+ return conn.reconnect(this);
+ }
+ }
+ if (cause instanceof OutOfSequenceEnvelopeException) {
+ final AbstractClientConnection<T> conn = getConnection(command);
+ if (conn instanceof ReconnectingClientConnection) {
+ // Already reconnecting, do not churn the logs
+ return this;
+ } 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);
+ }
+ }