in src/main/java/com/alibaba/cloudapi/sdk/client/ApacheIdleConnectionCleaner.java [72:94]
public void run() {
while (true) {
if (isShuttingDown) {
LOG.debug("Shutting down.");
return;
}
try {
Thread.sleep(PERIOD_SEC * 1000);
for (Entry<HttpClientConnectionManager, Long> entry : connMgrMap.entrySet()) {
try {
entry.getKey().closeIdleConnections(entry.getValue(), TimeUnit.MILLISECONDS);
} catch (Exception t) {
LOG.warn("close idle connections failed", t);
}
}
} catch (InterruptedException e){
LOG.debug("interrupted.", e);
} catch (Throwable t) {
LOG.warn("fatal error", t);
}
}
}