On Wed, 2018-05-16 at 22:40 +0300, Дмитрий Жихарев wrote: > Oleg, > > realistically I would expect the default timeout to be around 5 > seconds, as is the default value in the > PoolingHttpClientConnectionManager ( https://github.com/apache/httpco > mponents- > client/blob/master/httpclient5/src/main/java/org/apache/hc/client5/ht > tp/impl/io/PoolingHttpClientConnectionManager.java). IIRC, it was 2 > seconds in the 4.4 release. To me, for an http call 3 minutes looks > like an eternity. But that's just my opinion. > > I've made a small example: https://github.com/jihor/async-http-client > -notimeout-demo > > In the demo project, HttpAsyncClient 4.1.3 is used. > > The example runs 2 http post's (one without timeout, the other with a > timeout) on each of the following clients: > > > > - (sync) client with default configuration > (HttpClients.createDefault()). This client will wait endlessly if no > timeout is defined in the request; > > - (sync) client with custom RequestConfig. This client will always > exit after its timeout expires even if the request has no timeout > defined; > > - asyncClient with default configuration > (HttpAsyncClients.createDefault()). This client will wait endlessly > if no timeout is defined in the request; > > - asyncClient with custom connection manager and custom ioReactor. > This client will always exit after its timeout expires even if the > request has no timeout defined. > > > > To me, it seems like a pitfall that default configurations offer > unlimited timeouts for the requests which don't request specific > timeouts using request configs. >
Dmitry There are plenty of web services (specially in the corporate world) that take minutes to spit out some sort of a response back to the client. 5 seconds as a default would be _way_ too aggressive in my opinion. In fact, anything below a minute as a default could break a lot of applications. I am in favor of using a finite socket timeout by default in HC 5 but it should be reasonably conservative. Cheers Oleg --------------------------------------------------------------------- To unsubscribe, e-mail: httpclient-users-unsubscr...@hc.apache.org For additional commands, e-mail: httpclient-users-h...@hc.apache.org