ConnectionWatchdog should handle timer's IllegalStateException properly

pull/1025/head
Nikita 8 years ago
parent 90f1d528ca
commit 42d6df5752

@ -82,12 +82,16 @@ public class ConnectionWatchdog extends ChannelInboundHandlerAdapter {
return; return;
} }
timer.newTimeout(new TimerTask() { try {
@Override timer.newTimeout(new TimerTask() {
public void run(Timeout timeout) throws Exception { @Override
tryReconnect(connection, Math.min(BACKOFF_CAP, attempts + 1)); public void run(Timeout timeout) throws Exception {
} tryReconnect(connection, Math.min(BACKOFF_CAP, attempts + 1));
}, timeout, TimeUnit.MILLISECONDS); }
}, timeout, TimeUnit.MILLISECONDS);
} catch (IllegalStateException e) {
// skip
}
} }
private void tryReconnect(final RedisConnection connection, final int nextAttempt) { private void tryReconnect(final RedisConnection connection, final int nextAttempt) {

Loading…
Cancel
Save