Skip to content

Commit

Permalink
address comment
Browse files Browse the repository at this point in the history
  • Loading branch information
turboFei committed Mar 25, 2020
1 parent 02537b3 commit 9ff5ca2
Showing 1 changed file with 2 additions and 1 deletion.
Expand Up @@ -87,6 +87,7 @@ private static class ClientPool {
private EventLoopGroup workerGroup;
private final PooledByteBufAllocator pooledAllocator;
private final NettyMemoryMetrics metrics;
private final double fastFailTimeWindow;

public TransportClientFactory(
TransportContext context,
Expand All @@ -113,6 +114,7 @@ public TransportClientFactory(
}
this.metrics = new NettyMemoryMetrics(
this.pooledAllocator, conf.getModuleName() + "-client", conf);
fastFailTimeWindow = conf.ioRetryWaitTimeMs() * 0.95;
}

public MetricSet getAllMetrics() {
Expand Down Expand Up @@ -193,7 +195,6 @@ public TransportClient createClient(String remoteHost, int remotePort)
logger.info("Found inactive connection to {}, creating a new one.", resolvedAddress);
}
}
double fastFailTimeWindow = conf.ioRetryWaitTimeMs() * 0.95;
if (conf.maxIORetries() > 0 && System.currentTimeMillis() - clientPool.lastConnectionFailed <
fastFailTimeWindow) {
throw new IOException(
Expand Down

0 comments on commit 9ff5ca2

Please sign in to comment.