Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PoolingClientConnectionManager http client time out is set wrongly, which makes client is parking there when swift sever is busy even socketTimeout is set #123

Open
l0f011l opened this issue Jan 7, 2017 · 0 comments

Comments

@l0f011l
Copy link

l0f011l commented Jan 7, 2017

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;

}

@l0f011l l0f011l changed the title PoolingClientConnectionManager http client time out is set wrongly, which makes client is parking there even socketTimeout is set PoolingClientConnectionManager http client time out is set wrongly, which makes client is parking there when swift sever is busy even socketTimeout is set Jan 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant