PoolingClientConnectionManager http client time out is set wrongly, which makes client is parking there when swift sever is busy even socketTimeout is set #123
this.httpClient = new DefaultHttpClient(connectionManager);
if (socketTimeout != -1) {
LOG.info("JOSS / Set socket timeout on HttpClient: "+socketTimeout);
HttpParams params = this.httpClient.getParams();
HttpConnectionParams.setSoTimeout(params, socketTimeout);
}
socketTimeout value should be set to be the value of "http.conn-manager.timeout", as PoolingClientConnectionManager use it instead of "SO_TIMEOUT = "http.socket.timeout";"
if (timeout > 0) { -- timeout = value of http.conn-manager.timeout, not “http.socket.timeout”
deadline = new Date
(System.currentTimeMillis() + tunit.toMillis(timeout));
}
try {
if (this.cancelled) {
throw new InterruptedException("Operation interrupted");
}
boolean success = false;
if (deadline != null) {
success = this.condition.awaitUntil(deadline);
} else {
this.condition.await();
success = true;
}
this.httpClient = new DefaultHttpClient(connectionManager); if (socketTimeout != -1) { LOG.info("JOSS / Set socket timeout on HttpClient: "+socketTimeout); HttpParams params = this.httpClient.getParams(); HttpConnectionParams.setSoTimeout(params, socketTimeout); }
socketTimeout value should be set to be the value of "http.conn-manager.timeout", as PoolingClientConnectionManager use it instead of "SO_TIMEOUT = "http.socket.timeout";"
if (timeout > 0) { -- timeout = value of http.conn-manager.timeout, not “http.socket.timeout” deadline = new Date (System.currentTimeMillis() + tunit.toMillis(timeout)); }
try { if (this.cancelled) { throw new InterruptedException("Operation interrupted"); } boolean success = false; if (deadline != null) { success = this.condition.awaitUntil(deadline); } else { this.condition.await(); success = true; }