You are viewing a plain text version of this content. The canonical link for it is here.
Posted to httpclient-users@hc.apache.org by jo...@grupoventus.com on 2019/04/04 14:20:34 UTC

Socket timeout exception with HttpClient5

Hello Oleg,

I've come across with the following issue. Our application is contacting 
with a webservice that returns information about the requested hotels.
More hotels in the request, bigger the response size. This issue happens 
using both https or http.

Below the results of the test using curl, httpAsync 4.1.3 and 
httpclient5-5.0-beta3 with httpcore5-5.0-beta6 (all tests executed on 
the same server):

1) Using curl:

1 hotel -> 200 OK : 37K : 1.2s
2 hotels --> 200 OK : 74K : 1.4s
3 hotels --> 200 OK : 102K : 1.5s


2) Using HttpAsync 4.1.3:

1 hotel -> 200 OK : 37K : 1.2s
2 hotels --> 200 OK : 74K : 1.4s
3 hotels --> 200 OK : 102K : 1.5s


3) Using HttpClient5:

1 hotel -> 200 OK : 37K : 1.3s
2 hotels --> Socket Timeout
3 hotels --> Socket Timeout


The socket timeout error trace is:

java.net.SocketTimeoutException: 15,000 MILLISECONDS
         at 
org.apache.hc.core5.io.SocketTimeoutExceptionFactory.create(SocketTimeoutExceptionFactory.java:50)
         at 
org.apache.hc.core5.http.impl.nio.AbstractHttp1StreamDuplexer.onTimeout(AbstractHttp1StreamDuplexer.java:404)
         at 
org.apache.hc.core5.http.impl.nio.AbstractHttp1IOEventHandler.timeout(AbstractHttp1IOEventHandler.java:81)
         at 
org.apache.hc.core5.http.impl.nio.ClientHttp1IOEventHandler.timeout(ClientHttp1IOEventHandler.java:39)
         at 
org.apache.hc.core5.reactor.InternalDataChannel.onTimeout(InternalDataChannel.java:188)
         at 
org.apache.hc.core5.reactor.InternalChannel.checkTimeout(InternalChannel.java:67)
         at 
org.apache.hc.core5.reactor.SingleCoreIOReactor.checkTimeout(SingleCoreIOReactor.java:232)
         at 
org.apache.hc.core5.reactor.SingleCoreIOReactor.validateActiveChannels(SingleCoreIOReactor.java:165)
         at 
org.apache.hc.core5.reactor.SingleCoreIOReactor.doExecute(SingleCoreIOReactor.java:127)
         at 
org.apache.hc.core5.reactor.AbstractSingleCoreIOReactor.execute(AbstractSingleCoreIOReactor.java:81)
         at 
org.apache.hc.core5.reactor.IOReactorWorker.run(IOReactorWorker.java:44)
         at java.lang.Thread.run(Thread.java:748)


Traces within our 'AsyncResponseConsumer' show the following for the 
third case (3 hotels, 102K response size):

consumeResponse :: entityDetails = 
org.apache.hc.core5.http.impl.IncomingEntityDetails@4ed28646
consumeResponse :: headers = Date = Thu, 04 Apr 2019 13:41:33 GMT, 
Server = Apache, Keep-Alive = timeout=15, max=100, Connection = 
Keep-Alive, Transfer-Encoding = chunked, Content-Type = text/xml; 
charset=utf-8,

consume called :: iteration 0 :: block size read: 4072 bytes, total size 
read = 4072, total time spent = 57635 nanos.
consume called :: iteration 1 :: block size read: 8144 bytes, total size 
read = 12216, total time spent = 107300 nanos.
consume called :: iteration 2 :: block size read: 4126 bytes, total size 
read = 16342, total time spent = 136496 nanos.
consume called :: iteration 3 :: block size read: 5512 bytes, total size 
read = 21854, total time spent = 198755 nanos.
consume called :: iteration 4 :: block size read: 8192 bytes, total size 
read = 30046, total time spent = 229160 nanos.
consume called :: iteration 5 :: block size read: 5994 bytes, total size 
read = 36040, total time spent = 289098 nanos.
consume called :: iteration 6 :: block size read: 5094 bytes, total size 
read = 41134, total time spent = 311649 nanos.
consume called :: iteration 7 :: block size read: 3050 bytes, total size 
read = 44184, total time spent = 368913 nanos.
consume called :: iteration 8 :: block size read: 5126 bytes, total size 
read = 49310, total time spent = 427755 nanos.
consume called :: iteration 9 :: block size read: 8192 bytes, total size 
read = 57502, total time spent = 452800 nanos.
consume called :: iteration 10 :: block size read: 7044 bytes, total 
size read = 64546, total time spent = 474367 nanos.
consume called :: iteration 11 :: block size read: 4088 bytes, total 
size read = 68634, total time spent = 544338 nanos.

failed called :: java.net.SocketTimeoutException: 15,000 MILLISECONDS
         at 
org.apache.hc.core5.io.SocketTimeoutExceptionFactory.create(SocketTimeoutExceptionFactory.java:50)
         at 
org.apache.hc.core5.http.impl.nio.AbstractHttp1StreamDuplexer.onTimeout(AbstractHttp1StreamDuplexer.java:404)
         at 
org.apache.hc.core5.http.impl.nio.AbstractHttp1IOEventHandler.timeout(AbstractHttp1IOEventHandler.java:81)
         at 
org.apache.hc.core5.http.impl.nio.ClientHttp1IOEventHandler.timeout(ClientHttp1IOEventHandler.java:39)
         at 
org.apache.hc.core5.reactor.InternalDataChannel.onTimeout(InternalDataChannel.java:188)
         at 
org.apache.hc.core5.reactor.InternalChannel.checkTimeout(InternalChannel.java:67)
         at 
org.apache.hc.core5.reactor.SingleCoreIOReactor.checkTimeout(SingleCoreIOReactor.java:232)
         at 
org.apache.hc.core5.reactor.SingleCoreIOReactor.validateActiveChannels(SingleCoreIOReactor.java:165)
         at 
org.apache.hc.core5.reactor.SingleCoreIOReactor.doExecute(SingleCoreIOReactor.java:127)
         at 
org.apache.hc.core5.reactor.AbstractSingleCoreIOReactor.execute(AbstractSingleCoreIOReactor.java:81)
         at 
org.apache.hc.core5.reactor.IOReactorWorker.run(IOReactorWorker.java:44)
         at java.lang.Thread.run(Thread.java:748)


I'm trying to debug, but I'm not able to log anything into the http 
client log. The log file is created but nothing is logged. I'm using 
log4j2 in this way:

<!-- HTTP log for debug purposes -->
<File name="HTTP_LOG" fileName="${sys:log.dir}httpClient5.log" 
append="true" immediateFlush="true">
<PatternLayout>
<Pattern>%m%n</Pattern>
</PatternLayout>
</File>

<!-- HTTP enable logging -->
<Logger name="org.apache.hc" level="debug" includeLocation="false" 
additivity="false">
<AppenderRef ref="HTTP_LOG"/>
</Logger>



I'm logging correctly into another log files using identical 
configuration ... What's wrong in this log4j2 configuration?

I have executed this test several times (request with 3 hotels) ... it 
seems to always stop after reading more than (or around) 64K of data.

If I could debug I would be able to give more information.

Thanks,

Joan.


---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org


RE: Socket timeout exception with HttpClient5

Posted by Joan grupoventus <jo...@grupoventus.com>.
Hi again,

To discard a particular issue with the destination endpoint used, I have tried to send a similar request from this server to another server within the same network. The result is similar, this time is able to read 92313 bytes of 101011 in just 0,26ms and then a wait of 14,75s until reaching the response timeout:

consumeResponse :: entityDetails = org.apache.hc.core5.http.impl.IncomingEntityDetails@54dc9d56
consumeResponse :: headers = Content-Length = 101011, Content-Type = application/xml, Date = Thu, 04 Apr 2019 15:35:40 GMT,

consume called :: iteration 0 :: block size read: 3985 bytes, total size read = 3985, total time spent = 46152 nanos.
consume called :: iteration 1 :: block size read: 8192 bytes, total size read = 12177, total time spent = 65443 nanos.
consume called :: iteration 2 :: block size read: 8192 bytes, total size read = 20369, total time spent = 80566 nanos.
consume called :: iteration 3 :: block size read: 8192 bytes, total size read = 28561, total time spent = 95823 nanos.
consume called :: iteration 4 :: block size read: 8192 bytes, total size read = 36753, total time spent = 110210 nanos.
consume called :: iteration 5 :: block size read: 3432 bytes, total size read = 40185, total time spent = 122873 nanos.
consume called :: iteration 6 :: block size read: 2896 bytes, total size read = 43081, total time spent = 138658 nanos.
consume called :: iteration 7 :: block size read: 8192 bytes, total size read = 51273, total time spent = 157141 nanos.
consume called :: iteration 8 :: block size read: 6288 bytes, total size read = 57561, total time spent = 171490 nanos.
consume called :: iteration 9 :: block size read: 8192 bytes, total size read = 65753, total time spent = 188350 nanos.
consume called :: iteration 10 :: block size read: 8192 bytes, total size read = 73945, total time spent = 217534 nanos.
consume called :: iteration 11 :: block size read: 8192 bytes, total size read = 82137, total time spent = 234016 nanos.
consume called :: iteration 12 :: block size read: 8192 bytes, total size read = 90329, total time spent = 249907 nanos.
consume called :: iteration 13 :: block size read: 1984 bytes, total size read = 92313, total time spent = 263477 nanos.

Finish java.net.SocketTimeoutException: 15,000 MILLISECONDS
        at org.apache.hc.core5.io.SocketTimeoutExceptionFactory.create(SocketTimeoutExceptionFactory.java:50)
        at org.apache.hc.core5.http.impl.nio.AbstractHttp1StreamDuplexer.onTimeout(AbstractHttp1StreamDuplexer.java:404)
        at org.apache.hc.core5.http.impl.nio.AbstractHttp1IOEventHandler.timeout(AbstractHttp1IOEventHandler.java:81)
        at org.apache.hc.core5.http.impl.nio.ClientHttp1IOEventHandler.timeout(ClientHttp1IOEventHandler.java:39)
        at org.apache.hc.core5.reactor.InternalDataChannel.onTimeout(InternalDataChannel.java:188)
        at org.apache.hc.core5.reactor.InternalChannel.checkTimeout(InternalChannel.java:67)
        at org.apache.hc.core5.reactor.SingleCoreIOReactor.checkTimeout(SingleCoreIOReactor.java:232)
        at org.apache.hc.core5.reactor.SingleCoreIOReactor.validateActiveChannels(SingleCoreIOReactor.java:165)
        at org.apache.hc.core5.reactor.SingleCoreIOReactor.doExecute(SingleCoreIOReactor.java:127)
        at org.apache.hc.core5.reactor.AbstractSingleCoreIOReactor.execute(AbstractSingleCoreIOReactor.java:81)
        at org.apache.hc.core5.reactor.IOReactorWorker.run(IOReactorWorker.java:44)
        at java.lang.Thread.run(Thread.java:748)


The same execution with a curl or using HttpAsync 4.1.3 works fine.

Thanks,
Joan.

-----Original Message-----
From: joan.balaguero@grupoventus.com [mailto:joan.balaguero@grupoventus.com] 
Sent: Thursday, April 4, 2019 4:21 PM
To: httpclient-users@hc.apache.org
Subject: Socket timeout exception with HttpClient5

Hello Oleg,

I've come across with the following issue. Our application is contacting with a webservice that returns information about the requested hotels.
More hotels in the request, bigger the response size. This issue happens using both https or http.

Below the results of the test using curl, httpAsync 4.1.3 and
httpclient5-5.0-beta3 with httpcore5-5.0-beta6 (all tests executed on the same server):

1) Using curl:

1 hotel -> 200 OK : 37K : 1.2s
2 hotels --> 200 OK : 74K : 1.4s
3 hotels --> 200 OK : 102K : 1.5s


2) Using HttpAsync 4.1.3:

1 hotel -> 200 OK : 37K : 1.2s
2 hotels --> 200 OK : 74K : 1.4s
3 hotels --> 200 OK : 102K : 1.5s


3) Using HttpClient5:

1 hotel -> 200 OK : 37K : 1.3s
2 hotels --> Socket Timeout
3 hotels --> Socket Timeout


The socket timeout error trace is:

java.net.SocketTimeoutException: 15,000 MILLISECONDS
         at
org.apache.hc.core5.io.SocketTimeoutExceptionFactory.create(SocketTimeoutExceptionFactory.java:50)
         at
org.apache.hc.core5.http.impl.nio.AbstractHttp1StreamDuplexer.onTimeout(AbstractHttp1StreamDuplexer.java:404)
         at
org.apache.hc.core5.http.impl.nio.AbstractHttp1IOEventHandler.timeout(AbstractHttp1IOEventHandler.java:81)
         at
org.apache.hc.core5.http.impl.nio.ClientHttp1IOEventHandler.timeout(ClientHttp1IOEventHandler.java:39)
         at
org.apache.hc.core5.reactor.InternalDataChannel.onTimeout(InternalDataChannel.java:188)
         at
org.apache.hc.core5.reactor.InternalChannel.checkTimeout(InternalChannel.java:67)
         at
org.apache.hc.core5.reactor.SingleCoreIOReactor.checkTimeout(SingleCoreIOReactor.java:232)
         at
org.apache.hc.core5.reactor.SingleCoreIOReactor.validateActiveChannels(SingleCoreIOReactor.java:165)
         at
org.apache.hc.core5.reactor.SingleCoreIOReactor.doExecute(SingleCoreIOReactor.java:127)
         at
org.apache.hc.core5.reactor.AbstractSingleCoreIOReactor.execute(AbstractSingleCoreIOReactor.java:81)
         at
org.apache.hc.core5.reactor.IOReactorWorker.run(IOReactorWorker.java:44)
         at java.lang.Thread.run(Thread.java:748)


Traces within our 'AsyncResponseConsumer' show the following for the third case (3 hotels, 102K response size):

consumeResponse :: entityDetails =
org.apache.hc.core5.http.impl.IncomingEntityDetails@4ed28646
consumeResponse :: headers = Date = Thu, 04 Apr 2019 13:41:33 GMT, Server = Apache, Keep-Alive = timeout=15, max=100, Connection = Keep-Alive, Transfer-Encoding = chunked, Content-Type = text/xml; charset=utf-8,

consume called :: iteration 0 :: block size read: 4072 bytes, total size read = 4072, total time spent = 57635 nanos.
consume called :: iteration 1 :: block size read: 8144 bytes, total size read = 12216, total time spent = 107300 nanos.
consume called :: iteration 2 :: block size read: 4126 bytes, total size read = 16342, total time spent = 136496 nanos.
consume called :: iteration 3 :: block size read: 5512 bytes, total size read = 21854, total time spent = 198755 nanos.
consume called :: iteration 4 :: block size read: 8192 bytes, total size read = 30046, total time spent = 229160 nanos.
consume called :: iteration 5 :: block size read: 5994 bytes, total size read = 36040, total time spent = 289098 nanos.
consume called :: iteration 6 :: block size read: 5094 bytes, total size read = 41134, total time spent = 311649 nanos.
consume called :: iteration 7 :: block size read: 3050 bytes, total size read = 44184, total time spent = 368913 nanos.
consume called :: iteration 8 :: block size read: 5126 bytes, total size read = 49310, total time spent = 427755 nanos.
consume called :: iteration 9 :: block size read: 8192 bytes, total size read = 57502, total time spent = 452800 nanos.
consume called :: iteration 10 :: block size read: 7044 bytes, total size read = 64546, total time spent = 474367 nanos.
consume called :: iteration 11 :: block size read: 4088 bytes, total size read = 68634, total time spent = 544338 nanos.

failed called :: java.net.SocketTimeoutException: 15,000 MILLISECONDS
         at
org.apache.hc.core5.io.SocketTimeoutExceptionFactory.create(SocketTimeoutExceptionFactory.java:50)
         at
org.apache.hc.core5.http.impl.nio.AbstractHttp1StreamDuplexer.onTimeout(AbstractHttp1StreamDuplexer.java:404)
         at
org.apache.hc.core5.http.impl.nio.AbstractHttp1IOEventHandler.timeout(AbstractHttp1IOEventHandler.java:81)
         at
org.apache.hc.core5.http.impl.nio.ClientHttp1IOEventHandler.timeout(ClientHttp1IOEventHandler.java:39)
         at
org.apache.hc.core5.reactor.InternalDataChannel.onTimeout(InternalDataChannel.java:188)
         at
org.apache.hc.core5.reactor.InternalChannel.checkTimeout(InternalChannel.java:67)
         at
org.apache.hc.core5.reactor.SingleCoreIOReactor.checkTimeout(SingleCoreIOReactor.java:232)
         at
org.apache.hc.core5.reactor.SingleCoreIOReactor.validateActiveChannels(SingleCoreIOReactor.java:165)
         at
org.apache.hc.core5.reactor.SingleCoreIOReactor.doExecute(SingleCoreIOReactor.java:127)
         at
org.apache.hc.core5.reactor.AbstractSingleCoreIOReactor.execute(AbstractSingleCoreIOReactor.java:81)
         at
org.apache.hc.core5.reactor.IOReactorWorker.run(IOReactorWorker.java:44)
         at java.lang.Thread.run(Thread.java:748)


I'm trying to debug, but I'm not able to log anything into the http client log. The log file is created but nothing is logged. I'm using
log4j2 in this way:

<!-- HTTP log for debug purposes -->
<File name="HTTP_LOG" fileName="${sys:log.dir}httpClient5.log" 
append="true" immediateFlush="true">
<PatternLayout>
<Pattern>%m%n</Pattern>
</PatternLayout>
</File>

<!-- HTTP enable logging -->
<Logger name="org.apache.hc" level="debug" includeLocation="false" 
additivity="false">
<AppenderRef ref="HTTP_LOG"/>
</Logger>



I'm logging correctly into another log files using identical configuration ... What's wrong in this log4j2 configuration?

I have executed this test several times (request with 3 hotels) ... it seems to always stop after reading more than (or around) 64K of data.

If I could debug I would be able to give more information.

Thanks,

Joan.


---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org


RE: Socket timeout exception with HttpClient5

Posted by Joan grupoventus <jo...@grupoventus.com>.
Hi Oleg,

Ok, let me prepare this test because the behavior of httpclient5-5.0-beta4 / httpcore5-5.0-beta7 is the same than httpclient5-5.0-beta3 / httpcore5-5.0-beta6: the 'AbstractCharResponseConsumer' works and the 'AsyncResponseConsumer' does not.

Thanks,
Joan.

-----Original Message-----
From: Oleg Kalnichevski [mailto:olegk@apache.org] 
Sent: Friday, April 5, 2019 2:59 PM
To: HttpClient User Discussion <ht...@hc.apache.org>
Subject: Re: Socket timeout exception with HttpClient5

On Fri, 2019-04-05 at 14:51 +0200, Joan grupoventus wrote:
> Hi Oleg,
> 
> I think I can bring a bit of light to this matter.
> 
> 1. httpclient5-5.0-beta3 / httpcore5-5.0-beta6 : I have changed my 
> code to use a 'AbstractCharResponseConsumer' instead of the original ' 
> AsyncResponseConsumer' (rest of code remains identical) and  works 
> perfectly.
> 
> 2. I remembered some changes in the ' AsyncResponseConsumer', the 
> 'consume' method now does not return a 'int'. So I tried to use the 
> 'AsyncResponseConsumer' with httpclient5-5.0-beta2 / httpcore5-5.0-
> beta5 and also works perfectly.
> 
> 
> So it seems the 'AsyncResponseConsumer' works with the combination
> "httpclient5-5.0-beta2 / httpcore5-5.0-beta5", but not with the 
> combination "httpclient5-5.0-beta3 / httpcore5-5.0-beta6".
> 
> Does this help?
> 
> Thanks,
> Joan.
> 

Please upgrade to BETA4 and re-test. I will need a complete wire/context log of the session and preferably a self-contained test app that demonstrates the usage of HC APIs. GitHub may be a reasonable
choice to host both the app and the log.   

Oleg 

> 
> -----Original Message-----
> From: Oleg Kalnichevski [mailto:olegk@apache.org]
> Sent: Friday, April 5, 2019 9:31 AM
> To: HttpClient User Discussion <ht...@hc.apache.org>
> Subject: Re: Socket timeout exception with HttpClient5
> 
> On Thu, 2019-04-04 at 22:35 +0200, Joan grupoventus wrote:
> > Hi Oleg,
> > 
> > Links to 2 log files, one against a https endpoint and another one 
> > against a http endpoint:
> > 
> > https endpoint:
> > http://www.grupoventus.com/download/httpClient5_https.log
> > 
> > http endpoint:
> > http://www.grupoventus.com/download/httpClient5_http.log
> > 
> > 
> > Thanks,
> > Joan.
> > 
> 
> Joan,
> 
> I see nothing in the logs other than the server not sending more data.
> There are no timestamps, so I cannot say how long it took between 
> events in the log.
> 
> Please upgrade to HttpClient 5.0-beta4 (you will have to build it from 
> source or wait a few days before it becomes available in Maven
> Central) and re-run the application with the logging on. I will also 
> need to see your code. A test app reproducing the issue would probably 
> be the best.
> 
> 
> 
https://github.com/apache/httpcomponents-client/releases/tag/5.0-beta4-RC1
> 
> Oleg
> 
> > -----Original Message-----
> > From: Joan grupoventus [mailto:joan.balaguero@grupoventus.com]
> > Sent: Thursday, April 4, 2019 8:49 PM
> > To: 'HttpClient User Discussion' <ht...@hc.apache.org>
> > Subject: RE: Socket timeout exception with HttpClient5
> > 
> > Hi Oleg,
> > 
> > Attached the http client log (finally) for one request that ends up 
> > with Socket timeout.
> > 
> > Thanks,
> > 
> > Joan.
> > 
> > -----Original Message-----
> > From: Oleg Kalnichevski [mailto:olegk@apache.org]
> > Sent: Thursday, April 4, 2019 8:31 PM
> > To: HttpClient User Discussion <ht...@hc.apache.org>
> > Subject: Re: Socket timeout exception with HttpClient5
> > 
> > On Thu, 2019-04-04 at 20:08 +0200, Joan grupoventus wrote:
> > > Hi Oleg,
> > > 
> > > I will not be able to do much without a context / wire log or a 
> > > test application reproducing the issue.
> > > 
> > > --> Yes, I am aware of this ... I'm getting crazy trying to log
> > > the
> > > http traffic, no success. That's why I was asking you if you saw 
> > > something incorrect in our appender/logger config.
> > > 
> > > Is the logger name "org.apache.hc" right?
> > 
> > Yes, this looks correct as well as the rest of log4j2 config but I 
> > am no log4j2 specialist.
> > 
> > Oleg
> > 
> > >  With HttpClient 4 I was using "org.apache.http.impl.conn" , 
> > > "org.apache.http.impl.client" and "org.apache.http.client".
> > > 
> > > Thanks,
> > > 
> > > Joan.
> > > 
> > > -----Original Message-----
> > > From: Oleg Kalnichevski [mailto:olegk@apache.org]
> > > Sent: Thursday, April 4, 2019 7:56 PM
> > > To: HttpClient User Discussion <ht...@hc.apache.org>
> > > Subject: Re: Socket timeout exception with HttpClient5
> > > 
> > > On Thu, 2019-04-04 at 16:20 +0200, joan.balaguero@grupoventus.com
> > > wrote:
> > > > Hello Oleg,
> > > > 
> > > > I've come across with the following issue. Our application is 
> > > > contacting with a webservice that returns information about the 
> > > > requested hotels.
> > > > More hotels in the request, bigger the response size. This issue 
> > > > happens using both https or http.
> > > > 
> > > > Below the results of the test using curl, httpAsync 4.1.3 and
> > > > httpclient5-5.0-beta3 with httpcore5-5.0-beta6 (all tests 
> > > > executed on the same server):
> > > > 
> > > > 1) Using curl:
> > > > 
> > > > 1 hotel -> 200 OK : 37K : 1.2s
> > > > 2 hotels --> 200 OK : 74K : 1.4s
> > > > 3 hotels --> 200 OK : 102K : 1.5s
> > > > 
> > > > 
> > > > 2) Using HttpAsync 4.1.3:
> > > > 
> > > > 1 hotel -> 200 OK : 37K : 1.2s
> > > > 2 hotels --> 200 OK : 74K : 1.4s
> > > > 3 hotels --> 200 OK : 102K : 1.5s
> > > > 
> > > > 
> > > > 3) Using HttpClient5:
> > > > 
> > > > 1 hotel -> 200 OK : 37K : 1.3s
> > > > 2 hotels --> Socket Timeout
> > > > 3 hotels --> Socket Timeout
> > > > 
> > > > 
> > > > The socket timeout error trace is:
> > > > 
> > > > java.net.SocketTimeoutException: 15,000 MILLISECONDS
> > > >          at
> > > > 
> > > 
> > > ...
> > > 
> > > > I'm trying to debug, but I'm not able to log anything into the 
> > > > http client log. The log file is created but nothing is logged.
> > > > I'm using
> > > > log4j2 in this way:
> > > > 
> > > > <!-- HTTP log for debug purposes --> <File name="HTTP_LOG" 
> > > > fileName="${sys:log.dir}httpClient5.log"
> > > > append="true" immediateFlush="true"> <PatternLayout> 
> > > > <Pattern>%m%n</Pattern> </PatternLayout> </File>
> > > > 
> > > > <!-- HTTP enable logging -->
> > > > <Logger name="org.apache.hc" level="debug"
> > > > includeLocation="false" 
> > > > additivity="false">
> > > > <AppenderRef ref="HTTP_LOG"/>
> > > > </Logger>
> > > > 
> > > > 
> > > > 
> > > > I'm logging correctly into another log files using identical 
> > > > configuration ... What's wrong in this log4j2 configuration?
> > > > 
> > > > I have executed this test several times (request with 3
> > > > hotels)
> > > > ...
> > > > it
> > > > seems to always stop after reading more than (or around) 64K of 
> > > > data.
> > > > 
> > > > If I could debug I would be able to give more information.
> > > > 
> > > 
> > > Hi Joan
> > > 
> > > I will not be able to do much without a context / wire log or a 
> > > test application reproducing the issue.
> > > 
> > > Oleg
> > > 
> > > 
> > > 
> > > -----------------------------------------------------------------
> > > ----
> > > To unsubscribe, e-mail: 
> > > httpclient-users-unsubscribe@hc.apache.org
> > > For additional commands, e-mail: 
> > > httpclient-users-help@hc.apache.org
> > > 
> > > 
> > > 
> > > 
> > > -----------------------------------------------------------------
> > > ----
> > > To unsubscribe, e-mail: 
> > > httpclient-users-unsubscribe@hc.apache.org
> > > For additional commands, e-mail: 
> > > httpclient-users-help@hc.apache.org
> > > 
> > 
> > 
> > -----------------------------------------------------------------
> > ----
> > To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
> > For additional commands, e-mail: 
> > httpclient-users-help@hc.apache.org
> > 
> > 
> > 
> > 
> > 
> > -----------------------------------------------------------------
> > ----
> > To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
> > For additional commands, e-mail: 
> > httpclient-users-help@hc.apache.org
> > 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
> For additional commands, e-mail: httpclient-users-help@hc.apache.org
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
> For additional commands, e-mail: httpclient-users-help@hc.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org


Re: Socket timeout exception with HttpClient5

Posted by Oleg Kalnichevski <ol...@apache.org>.
On Fri, 2019-04-05 at 14:51 +0200, Joan grupoventus wrote:
> Hi Oleg,
> 
> I think I can bring a bit of light to this matter.
> 
> 1. httpclient5-5.0-beta3 / httpcore5-5.0-beta6 : I have changed my
> code to use a 'AbstractCharResponseConsumer' instead of the original
> ' AsyncResponseConsumer' (rest of code remains identical) and  works
> perfectly.
> 
> 2. I remembered some changes in the ' AsyncResponseConsumer', the
> 'consume' method now does not return a 'int'. So I tried to use the
> 'AsyncResponseConsumer' with httpclient5-5.0-beta2 / httpcore5-5.0-
> beta5 and also works perfectly.
> 
> 
> So it seems the 'AsyncResponseConsumer' works with the combination
> "httpclient5-5.0-beta2 / httpcore5-5.0-beta5", but not with the
> combination "httpclient5-5.0-beta3 / httpcore5-5.0-beta6".
> 
> Does this help?
> 
> Thanks,
> Joan.
> 

Please upgrade to BETA4 and re-test. I will need a complete
wire/context log of the session and preferably a self-contained test
app that demonstrates the usage of HC APIs. GitHub may be a reasonable
choice to host both the app and the log.   

Oleg 

> 
> -----Original Message-----
> From: Oleg Kalnichevski [mailto:olegk@apache.org] 
> Sent: Friday, April 5, 2019 9:31 AM
> To: HttpClient User Discussion <ht...@hc.apache.org>
> Subject: Re: Socket timeout exception with HttpClient5
> 
> On Thu, 2019-04-04 at 22:35 +0200, Joan grupoventus wrote:
> > Hi Oleg,
> > 
> > Links to 2 log files, one against a https endpoint and another one 
> > against a http endpoint:
> > 
> > https endpoint:
> > http://www.grupoventus.com/download/httpClient5_https.log
> > 
> > http endpoint:
> > http://www.grupoventus.com/download/httpClient5_http.log
> > 
> > 
> > Thanks,
> > Joan.
> > 
> 
> Joan,
> 
> I see nothing in the logs other than the server not sending more
> data.
> There are no timestamps, so I cannot say how long it took between
> events in the log.
> 
> Please upgrade to HttpClient 5.0-beta4 (you will have to build it
> from source or wait a few days before it becomes available in Maven
> Central) and re-run the application with the logging on. I will also
> need to see your code. A test app reproducing the issue would
> probably be the best.
> 
> 
> 
https://github.com/apache/httpcomponents-client/releases/tag/5.0-beta4-RC1
> 
> Oleg
> 
> > -----Original Message-----
> > From: Joan grupoventus [mailto:joan.balaguero@grupoventus.com]
> > Sent: Thursday, April 4, 2019 8:49 PM
> > To: 'HttpClient User Discussion' <ht...@hc.apache.org>
> > Subject: RE: Socket timeout exception with HttpClient5
> > 
> > Hi Oleg,
> > 
> > Attached the http client log (finally) for one request that ends
> > up 
> > with Socket timeout.
> > 
> > Thanks,
> > 
> > Joan.
> > 
> > -----Original Message-----
> > From: Oleg Kalnichevski [mailto:olegk@apache.org]
> > Sent: Thursday, April 4, 2019 8:31 PM
> > To: HttpClient User Discussion <ht...@hc.apache.org>
> > Subject: Re: Socket timeout exception with HttpClient5
> > 
> > On Thu, 2019-04-04 at 20:08 +0200, Joan grupoventus wrote:
> > > Hi Oleg,
> > > 
> > > I will not be able to do much without a context / wire log or a
> > > test 
> > > application reproducing the issue.
> > > 
> > > --> Yes, I am aware of this ... I'm getting crazy trying to log
> > > the
> > > http traffic, no success. That's why I was asking you if you saw 
> > > something incorrect in our appender/logger config.
> > > 
> > > Is the logger name "org.apache.hc" right?
> > 
> > Yes, this looks correct as well as the rest of log4j2 config but I
> > am 
> > no log4j2 specialist.
> > 
> > Oleg
> > 
> > >  With HttpClient 4 I was using "org.apache.http.impl.conn" , 
> > > "org.apache.http.impl.client" and "org.apache.http.client".
> > > 
> > > Thanks,
> > > 
> > > Joan.
> > > 
> > > -----Original Message-----
> > > From: Oleg Kalnichevski [mailto:olegk@apache.org]
> > > Sent: Thursday, April 4, 2019 7:56 PM
> > > To: HttpClient User Discussion <ht...@hc.apache.org>
> > > Subject: Re: Socket timeout exception with HttpClient5
> > > 
> > > On Thu, 2019-04-04 at 16:20 +0200, joan.balaguero@grupoventus.com
> > > wrote:
> > > > Hello Oleg,
> > > > 
> > > > I've come across with the following issue. Our application is 
> > > > contacting with a webservice that returns information about
> > > > the 
> > > > requested hotels.
> > > > More hotels in the request, bigger the response size. This
> > > > issue 
> > > > happens using both https or http.
> > > > 
> > > > Below the results of the test using curl, httpAsync 4.1.3 and
> > > > httpclient5-5.0-beta3 with httpcore5-5.0-beta6 (all tests
> > > > executed 
> > > > on the same server):
> > > > 
> > > > 1) Using curl:
> > > > 
> > > > 1 hotel -> 200 OK : 37K : 1.2s
> > > > 2 hotels --> 200 OK : 74K : 1.4s
> > > > 3 hotels --> 200 OK : 102K : 1.5s
> > > > 
> > > > 
> > > > 2) Using HttpAsync 4.1.3:
> > > > 
> > > > 1 hotel -> 200 OK : 37K : 1.2s
> > > > 2 hotels --> 200 OK : 74K : 1.4s
> > > > 3 hotels --> 200 OK : 102K : 1.5s
> > > > 
> > > > 
> > > > 3) Using HttpClient5:
> > > > 
> > > > 1 hotel -> 200 OK : 37K : 1.3s
> > > > 2 hotels --> Socket Timeout
> > > > 3 hotels --> Socket Timeout
> > > > 
> > > > 
> > > > The socket timeout error trace is:
> > > > 
> > > > java.net.SocketTimeoutException: 15,000 MILLISECONDS
> > > >          at
> > > > 
> > > 
> > > ...
> > > 
> > > > I'm trying to debug, but I'm not able to log anything into the 
> > > > http client log. The log file is created but nothing is
> > > > logged. 
> > > > I'm using
> > > > log4j2 in this way:
> > > > 
> > > > <!-- HTTP log for debug purposes --> <File name="HTTP_LOG" 
> > > > fileName="${sys:log.dir}httpClient5.log"
> > > > append="true" immediateFlush="true"> <PatternLayout> 
> > > > <Pattern>%m%n</Pattern> </PatternLayout> </File>
> > > > 
> > > > <!-- HTTP enable logging -->
> > > > <Logger name="org.apache.hc" level="debug"
> > > > includeLocation="false" 
> > > > additivity="false">
> > > > <AppenderRef ref="HTTP_LOG"/>
> > > > </Logger>
> > > > 
> > > > 
> > > > 
> > > > I'm logging correctly into another log files using identical 
> > > > configuration ... What's wrong in this log4j2 configuration?
> > > > 
> > > > I have executed this test several times (request with 3
> > > > hotels) 
> > > > ...
> > > > it
> > > > seems to always stop after reading more than (or around) 64K
> > > > of 
> > > > data.
> > > > 
> > > > If I could debug I would be able to give more information.
> > > > 
> > > 
> > > Hi Joan
> > > 
> > > I will not be able to do much without a context / wire log or a
> > > test 
> > > application reproducing the issue.
> > > 
> > > Oleg
> > > 
> > > 
> > > 
> > > -----------------------------------------------------------------
> > > ----
> > > To unsubscribe, e-mail: 
> > > httpclient-users-unsubscribe@hc.apache.org
> > > For additional commands, e-mail: 
> > > httpclient-users-help@hc.apache.org
> > > 
> > > 
> > > 
> > > 
> > > -----------------------------------------------------------------
> > > ----
> > > To unsubscribe, e-mail: 
> > > httpclient-users-unsubscribe@hc.apache.org
> > > For additional commands, e-mail: 
> > > httpclient-users-help@hc.apache.org
> > > 
> > 
> > 
> > -----------------------------------------------------------------
> > ----
> > To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
> > For additional commands, e-mail: 
> > httpclient-users-help@hc.apache.org
> > 
> > 
> > 
> > 
> > 
> > -----------------------------------------------------------------
> > ----
> > To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
> > For additional commands, e-mail: 
> > httpclient-users-help@hc.apache.org
> > 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
> For additional commands, e-mail: httpclient-users-help@hc.apache.org
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
> For additional commands, e-mail: httpclient-users-help@hc.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org


RE: Socket timeout exception with HttpClient5

Posted by Joan grupoventus <jo...@grupoventus.com>.
Hi Oleg,

I think I can bring a bit of light to this matter.

1. httpclient5-5.0-beta3 / httpcore5-5.0-beta6 : I have changed my code to use a 'AbstractCharResponseConsumer' instead of the original ' AsyncResponseConsumer' (rest of code remains identical) and  works perfectly.

2. I remembered some changes in the ' AsyncResponseConsumer', the 'consume' method now does not return a 'int'. So I tried to use the 'AsyncResponseConsumer' with httpclient5-5.0-beta2 / httpcore5-5.0-beta5 and also works perfectly.


So it seems the 'AsyncResponseConsumer' works with the combination "httpclient5-5.0-beta2 / httpcore5-5.0-beta5", but not with the combination "httpclient5-5.0-beta3 / httpcore5-5.0-beta6".

Does this help?

Thanks,
Joan.


-----Original Message-----
From: Oleg Kalnichevski [mailto:olegk@apache.org] 
Sent: Friday, April 5, 2019 9:31 AM
To: HttpClient User Discussion <ht...@hc.apache.org>
Subject: Re: Socket timeout exception with HttpClient5

On Thu, 2019-04-04 at 22:35 +0200, Joan grupoventus wrote:
> Hi Oleg,
> 
> Links to 2 log files, one against a https endpoint and another one 
> against a http endpoint:
> 
> https endpoint:
> http://www.grupoventus.com/download/httpClient5_https.log
> 
> http endpoint:
> http://www.grupoventus.com/download/httpClient5_http.log
> 
> 
> Thanks,
> Joan.
> 

Joan,

I see nothing in the logs other than the server not sending more data.
There are no timestamps, so I cannot say how long it took between events in the log.

Please upgrade to HttpClient 5.0-beta4 (you will have to build it from source or wait a few days before it becomes available in Maven Central) and re-run the application with the logging on. I will also need to see your code. A test app reproducing the issue would probably be the best.


https://github.com/apache/httpcomponents-client/releases/tag/5.0-beta4-RC1

Oleg

> -----Original Message-----
> From: Joan grupoventus [mailto:joan.balaguero@grupoventus.com]
> Sent: Thursday, April 4, 2019 8:49 PM
> To: 'HttpClient User Discussion' <ht...@hc.apache.org>
> Subject: RE: Socket timeout exception with HttpClient5
> 
> Hi Oleg,
> 
> Attached the http client log (finally) for one request that ends up 
> with Socket timeout.
> 
> Thanks,
> 
> Joan.
> 
> -----Original Message-----
> From: Oleg Kalnichevski [mailto:olegk@apache.org]
> Sent: Thursday, April 4, 2019 8:31 PM
> To: HttpClient User Discussion <ht...@hc.apache.org>
> Subject: Re: Socket timeout exception with HttpClient5
> 
> On Thu, 2019-04-04 at 20:08 +0200, Joan grupoventus wrote:
> > Hi Oleg,
> > 
> > I will not be able to do much without a context / wire log or a test 
> > application reproducing the issue.
> > 
> > --> Yes, I am aware of this ... I'm getting crazy trying to log the
> > http traffic, no success. That's why I was asking you if you saw 
> > something incorrect in our appender/logger config.
> > 
> > Is the logger name "org.apache.hc" right?
> 
> Yes, this looks correct as well as the rest of log4j2 config but I am 
> no log4j2 specialist.
> 
> Oleg
> 
> >  With HttpClient 4 I was using "org.apache.http.impl.conn" , 
> > "org.apache.http.impl.client" and "org.apache.http.client".
> > 
> > Thanks,
> > 
> > Joan.
> > 
> > -----Original Message-----
> > From: Oleg Kalnichevski [mailto:olegk@apache.org]
> > Sent: Thursday, April 4, 2019 7:56 PM
> > To: HttpClient User Discussion <ht...@hc.apache.org>
> > Subject: Re: Socket timeout exception with HttpClient5
> > 
> > On Thu, 2019-04-04 at 16:20 +0200, joan.balaguero@grupoventus.com
> > wrote:
> > > Hello Oleg,
> > > 
> > > I've come across with the following issue. Our application is 
> > > contacting with a webservice that returns information about the 
> > > requested hotels.
> > > More hotels in the request, bigger the response size. This issue 
> > > happens using both https or http.
> > > 
> > > Below the results of the test using curl, httpAsync 4.1.3 and
> > > httpclient5-5.0-beta3 with httpcore5-5.0-beta6 (all tests executed 
> > > on the same server):
> > > 
> > > 1) Using curl:
> > > 
> > > 1 hotel -> 200 OK : 37K : 1.2s
> > > 2 hotels --> 200 OK : 74K : 1.4s
> > > 3 hotels --> 200 OK : 102K : 1.5s
> > > 
> > > 
> > > 2) Using HttpAsync 4.1.3:
> > > 
> > > 1 hotel -> 200 OK : 37K : 1.2s
> > > 2 hotels --> 200 OK : 74K : 1.4s
> > > 3 hotels --> 200 OK : 102K : 1.5s
> > > 
> > > 
> > > 3) Using HttpClient5:
> > > 
> > > 1 hotel -> 200 OK : 37K : 1.3s
> > > 2 hotels --> Socket Timeout
> > > 3 hotels --> Socket Timeout
> > > 
> > > 
> > > The socket timeout error trace is:
> > > 
> > > java.net.SocketTimeoutException: 15,000 MILLISECONDS
> > >          at
> > > 
> > 
> > ...
> > 
> > > I'm trying to debug, but I'm not able to log anything into the 
> > > http client log. The log file is created but nothing is logged. 
> > > I'm using
> > > log4j2 in this way:
> > > 
> > > <!-- HTTP log for debug purposes --> <File name="HTTP_LOG" 
> > > fileName="${sys:log.dir}httpClient5.log"
> > > append="true" immediateFlush="true"> <PatternLayout> 
> > > <Pattern>%m%n</Pattern> </PatternLayout> </File>
> > > 
> > > <!-- HTTP enable logging -->
> > > <Logger name="org.apache.hc" level="debug"
> > > includeLocation="false" 
> > > additivity="false">
> > > <AppenderRef ref="HTTP_LOG"/>
> > > </Logger>
> > > 
> > > 
> > > 
> > > I'm logging correctly into another log files using identical 
> > > configuration ... What's wrong in this log4j2 configuration?
> > > 
> > > I have executed this test several times (request with 3 hotels) 
> > > ...
> > > it
> > > seems to always stop after reading more than (or around) 64K of 
> > > data.
> > > 
> > > If I could debug I would be able to give more information.
> > > 
> > 
> > Hi Joan
> > 
> > I will not be able to do much without a context / wire log or a test 
> > application reproducing the issue.
> > 
> > Oleg
> > 
> > 
> > 
> > -----------------------------------------------------------------
> > ----
> > To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
> > For additional commands, e-mail: 
> > httpclient-users-help@hc.apache.org
> > 
> > 
> > 
> > 
> > -----------------------------------------------------------------
> > ----
> > To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
> > For additional commands, e-mail: 
> > httpclient-users-help@hc.apache.org
> > 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
> For additional commands, e-mail: httpclient-users-help@hc.apache.org
> 
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
> For additional commands, e-mail: httpclient-users-help@hc.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org


Re: Socket timeout exception with HttpClient5

Posted by Oleg Kalnichevski <ol...@apache.org>.
On Thu, 2019-04-04 at 22:35 +0200, Joan grupoventus wrote:
> Hi Oleg,
> 
> Links to 2 log files, one against a https endpoint and another one
> against a http endpoint:
> 
> https endpoint:
> http://www.grupoventus.com/download/httpClient5_https.log
> 
> http endpoint:
> http://www.grupoventus.com/download/httpClient5_http.log
> 
> 
> Thanks,
> Joan.
> 

Joan,

I see nothing in the logs other than the server not sending more data.
There are no timestamps, so I cannot say how long it took between
events in the log.

Please upgrade to HttpClient 5.0-beta4 (you will have to build it from
source or wait a few days before it becomes available in Maven Central)
and re-run the application with the logging on. I will also need to see
your code. A test app reproducing the issue would probably be the best.


https://github.com/apache/httpcomponents-client/releases/tag/5.0-beta4-RC1

Oleg

> -----Original Message-----
> From: Joan grupoventus [mailto:joan.balaguero@grupoventus.com] 
> Sent: Thursday, April 4, 2019 8:49 PM
> To: 'HttpClient User Discussion' <ht...@hc.apache.org>
> Subject: RE: Socket timeout exception with HttpClient5
> 
> Hi Oleg,
> 
> Attached the http client log (finally) for one request that ends up
> with Socket timeout.
> 
> Thanks,
> 
> Joan.
> 
> -----Original Message-----
> From: Oleg Kalnichevski [mailto:olegk@apache.org]
> Sent: Thursday, April 4, 2019 8:31 PM
> To: HttpClient User Discussion <ht...@hc.apache.org>
> Subject: Re: Socket timeout exception with HttpClient5
> 
> On Thu, 2019-04-04 at 20:08 +0200, Joan grupoventus wrote:
> > Hi Oleg,
> > 
> > I will not be able to do much without a context / wire log or a
> > test 
> > application reproducing the issue.
> > 
> > --> Yes, I am aware of this ... I'm getting crazy trying to log the
> > http traffic, no success. That's why I was asking you if you saw 
> > something incorrect in our appender/logger config.
> > 
> > Is the logger name "org.apache.hc" right?
> 
> Yes, this looks correct as well as the rest of log4j2 config but I am
> no log4j2 specialist.
> 
> Oleg
> 
> >  With HttpClient 4 I was using "org.apache.http.impl.conn" , 
> > "org.apache.http.impl.client" and "org.apache.http.client".
> > 
> > Thanks,
> > 
> > Joan.
> > 
> > -----Original Message-----
> > From: Oleg Kalnichevski [mailto:olegk@apache.org]
> > Sent: Thursday, April 4, 2019 7:56 PM
> > To: HttpClient User Discussion <ht...@hc.apache.org>
> > Subject: Re: Socket timeout exception with HttpClient5
> > 
> > On Thu, 2019-04-04 at 16:20 +0200, joan.balaguero@grupoventus.com
> > wrote:
> > > Hello Oleg,
> > > 
> > > I've come across with the following issue. Our application is 
> > > contacting with a webservice that returns information about the 
> > > requested hotels.
> > > More hotels in the request, bigger the response size. This issue 
> > > happens using both https or http.
> > > 
> > > Below the results of the test using curl, httpAsync 4.1.3 and
> > > httpclient5-5.0-beta3 with httpcore5-5.0-beta6 (all tests
> > > executed 
> > > on the same server):
> > > 
> > > 1) Using curl:
> > > 
> > > 1 hotel -> 200 OK : 37K : 1.2s
> > > 2 hotels --> 200 OK : 74K : 1.4s
> > > 3 hotels --> 200 OK : 102K : 1.5s
> > > 
> > > 
> > > 2) Using HttpAsync 4.1.3:
> > > 
> > > 1 hotel -> 200 OK : 37K : 1.2s
> > > 2 hotels --> 200 OK : 74K : 1.4s
> > > 3 hotels --> 200 OK : 102K : 1.5s
> > > 
> > > 
> > > 3) Using HttpClient5:
> > > 
> > > 1 hotel -> 200 OK : 37K : 1.3s
> > > 2 hotels --> Socket Timeout
> > > 3 hotels --> Socket Timeout
> > > 
> > > 
> > > The socket timeout error trace is:
> > > 
> > > java.net.SocketTimeoutException: 15,000 MILLISECONDS
> > >          at
> > > 
> > 
> > ...
> > 
> > > I'm trying to debug, but I'm not able to log anything into the
> > > http 
> > > client log. The log file is created but nothing is logged. I'm
> > > using
> > > log4j2 in this way:
> > > 
> > > <!-- HTTP log for debug purposes --> <File name="HTTP_LOG" 
> > > fileName="${sys:log.dir}httpClient5.log"
> > > append="true" immediateFlush="true"> <PatternLayout> 
> > > <Pattern>%m%n</Pattern> </PatternLayout> </File>
> > > 
> > > <!-- HTTP enable logging -->
> > > <Logger name="org.apache.hc" level="debug"
> > > includeLocation="false" 
> > > additivity="false">
> > > <AppenderRef ref="HTTP_LOG"/>
> > > </Logger>
> > > 
> > > 
> > > 
> > > I'm logging correctly into another log files using identical 
> > > configuration ... What's wrong in this log4j2 configuration?
> > > 
> > > I have executed this test several times (request with 3 hotels)
> > > ...
> > > it
> > > seems to always stop after reading more than (or around) 64K of 
> > > data.
> > > 
> > > If I could debug I would be able to give more information.
> > > 
> > 
> > Hi Joan
> > 
> > I will not be able to do much without a context / wire log or a
> > test 
> > application reproducing the issue.
> > 
> > Oleg
> > 
> > 
> > 
> > -----------------------------------------------------------------
> > ----
> > To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
> > For additional commands, e-mail: 
> > httpclient-users-help@hc.apache.org
> > 
> > 
> > 
> > 
> > -----------------------------------------------------------------
> > ----
> > To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
> > For additional commands, e-mail: 
> > httpclient-users-help@hc.apache.org
> > 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
> For additional commands, e-mail: httpclient-users-help@hc.apache.org
> 
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
> For additional commands, e-mail: httpclient-users-help@hc.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org


RE: Socket timeout exception with HttpClient5

Posted by Joan grupoventus <jo...@grupoventus.com>.
Hi Oleg,

Links to 2 log files, one against a https endpoint and another one against a http endpoint:

https endpoint:
http://www.grupoventus.com/download/httpClient5_https.log

http endpoint:
http://www.grupoventus.com/download/httpClient5_http.log


Thanks,
Joan.

-----Original Message-----
From: Joan grupoventus [mailto:joan.balaguero@grupoventus.com] 
Sent: Thursday, April 4, 2019 8:49 PM
To: 'HttpClient User Discussion' <ht...@hc.apache.org>
Subject: RE: Socket timeout exception with HttpClient5

Hi Oleg,

Attached the http client log (finally) for one request that ends up with Socket timeout.

Thanks,

Joan.

-----Original Message-----
From: Oleg Kalnichevski [mailto:olegk@apache.org]
Sent: Thursday, April 4, 2019 8:31 PM
To: HttpClient User Discussion <ht...@hc.apache.org>
Subject: Re: Socket timeout exception with HttpClient5

On Thu, 2019-04-04 at 20:08 +0200, Joan grupoventus wrote:
> Hi Oleg,
> 
> I will not be able to do much without a context / wire log or a test 
> application reproducing the issue.
> 
> --> Yes, I am aware of this ... I'm getting crazy trying to log the
> http traffic, no success. That's why I was asking you if you saw 
> something incorrect in our appender/logger config.
> 
> Is the logger name "org.apache.hc" right?

Yes, this looks correct as well as the rest of log4j2 config but I am no log4j2 specialist.

Oleg

>  With HttpClient 4 I was using "org.apache.http.impl.conn" , 
> "org.apache.http.impl.client" and "org.apache.http.client".
> 
> Thanks,
> 
> Joan.
> 
> -----Original Message-----
> From: Oleg Kalnichevski [mailto:olegk@apache.org]
> Sent: Thursday, April 4, 2019 7:56 PM
> To: HttpClient User Discussion <ht...@hc.apache.org>
> Subject: Re: Socket timeout exception with HttpClient5
> 
> On Thu, 2019-04-04 at 16:20 +0200, joan.balaguero@grupoventus.com
> wrote:
> > Hello Oleg,
> > 
> > I've come across with the following issue. Our application is 
> > contacting with a webservice that returns information about the 
> > requested hotels.
> > More hotels in the request, bigger the response size. This issue 
> > happens using both https or http.
> > 
> > Below the results of the test using curl, httpAsync 4.1.3 and
> > httpclient5-5.0-beta3 with httpcore5-5.0-beta6 (all tests executed 
> > on the same server):
> > 
> > 1) Using curl:
> > 
> > 1 hotel -> 200 OK : 37K : 1.2s
> > 2 hotels --> 200 OK : 74K : 1.4s
> > 3 hotels --> 200 OK : 102K : 1.5s
> > 
> > 
> > 2) Using HttpAsync 4.1.3:
> > 
> > 1 hotel -> 200 OK : 37K : 1.2s
> > 2 hotels --> 200 OK : 74K : 1.4s
> > 3 hotels --> 200 OK : 102K : 1.5s
> > 
> > 
> > 3) Using HttpClient5:
> > 
> > 1 hotel -> 200 OK : 37K : 1.3s
> > 2 hotels --> Socket Timeout
> > 3 hotels --> Socket Timeout
> > 
> > 
> > The socket timeout error trace is:
> > 
> > java.net.SocketTimeoutException: 15,000 MILLISECONDS
> >          at
> > 
> 
> ...
> 
> > I'm trying to debug, but I'm not able to log anything into the http 
> > client log. The log file is created but nothing is logged. I'm using
> > log4j2 in this way:
> > 
> > <!-- HTTP log for debug purposes --> <File name="HTTP_LOG" 
> > fileName="${sys:log.dir}httpClient5.log"
> > append="true" immediateFlush="true"> <PatternLayout> 
> > <Pattern>%m%n</Pattern> </PatternLayout> </File>
> > 
> > <!-- HTTP enable logging -->
> > <Logger name="org.apache.hc" level="debug" includeLocation="false" 
> > additivity="false">
> > <AppenderRef ref="HTTP_LOG"/>
> > </Logger>
> > 
> > 
> > 
> > I'm logging correctly into another log files using identical 
> > configuration ... What's wrong in this log4j2 configuration?
> > 
> > I have executed this test several times (request with 3 hotels) ...
> > it
> > seems to always stop after reading more than (or around) 64K of 
> > data.
> > 
> > If I could debug I would be able to give more information.
> > 
> 
> Hi Joan
> 
> I will not be able to do much without a context / wire log or a test 
> application reproducing the issue.
> 
> Oleg
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
> For additional commands, e-mail: httpclient-users-help@hc.apache.org
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
> For additional commands, e-mail: httpclient-users-help@hc.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org





---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org


RE: Socket timeout exception with HttpClient5

Posted by Joan grupoventus <jo...@grupoventus.com>.
Hi Oleg,

Attached the http client log (finally) for one request that ends up with Socket timeout.

Thanks,

Joan.

-----Original Message-----
From: Oleg Kalnichevski [mailto:olegk@apache.org] 
Sent: Thursday, April 4, 2019 8:31 PM
To: HttpClient User Discussion <ht...@hc.apache.org>
Subject: Re: Socket timeout exception with HttpClient5

On Thu, 2019-04-04 at 20:08 +0200, Joan grupoventus wrote:
> Hi Oleg,
> 
> I will not be able to do much without a context / wire log or a test 
> application reproducing the issue.
> 
> --> Yes, I am aware of this ... I'm getting crazy trying to log the
> http traffic, no success. That's why I was asking you if you saw 
> something incorrect in our appender/logger config.
> 
> Is the logger name "org.apache.hc" right?

Yes, this looks correct as well as the rest of log4j2 config but I am no log4j2 specialist.

Oleg

>  With HttpClient 4 I was using "org.apache.http.impl.conn" , 
> "org.apache.http.impl.client" and "org.apache.http.client".
> 
> Thanks,
> 
> Joan.
> 
> -----Original Message-----
> From: Oleg Kalnichevski [mailto:olegk@apache.org]
> Sent: Thursday, April 4, 2019 7:56 PM
> To: HttpClient User Discussion <ht...@hc.apache.org>
> Subject: Re: Socket timeout exception with HttpClient5
> 
> On Thu, 2019-04-04 at 16:20 +0200, joan.balaguero@grupoventus.com
> wrote:
> > Hello Oleg,
> > 
> > I've come across with the following issue. Our application is 
> > contacting with a webservice that returns information about the 
> > requested hotels.
> > More hotels in the request, bigger the response size. This issue 
> > happens using both https or http.
> > 
> > Below the results of the test using curl, httpAsync 4.1.3 and
> > httpclient5-5.0-beta3 with httpcore5-5.0-beta6 (all tests executed 
> > on the same server):
> > 
> > 1) Using curl:
> > 
> > 1 hotel -> 200 OK : 37K : 1.2s
> > 2 hotels --> 200 OK : 74K : 1.4s
> > 3 hotels --> 200 OK : 102K : 1.5s
> > 
> > 
> > 2) Using HttpAsync 4.1.3:
> > 
> > 1 hotel -> 200 OK : 37K : 1.2s
> > 2 hotels --> 200 OK : 74K : 1.4s
> > 3 hotels --> 200 OK : 102K : 1.5s
> > 
> > 
> > 3) Using HttpClient5:
> > 
> > 1 hotel -> 200 OK : 37K : 1.3s
> > 2 hotels --> Socket Timeout
> > 3 hotels --> Socket Timeout
> > 
> > 
> > The socket timeout error trace is:
> > 
> > java.net.SocketTimeoutException: 15,000 MILLISECONDS
> >          at
> > 
> 
> ...
> 
> > I'm trying to debug, but I'm not able to log anything into the http 
> > client log. The log file is created but nothing is logged. I'm using
> > log4j2 in this way:
> > 
> > <!-- HTTP log for debug purposes --> <File name="HTTP_LOG" 
> > fileName="${sys:log.dir}httpClient5.log"
> > append="true" immediateFlush="true"> <PatternLayout> 
> > <Pattern>%m%n</Pattern> </PatternLayout> </File>
> > 
> > <!-- HTTP enable logging -->
> > <Logger name="org.apache.hc" level="debug" includeLocation="false" 
> > additivity="false">
> > <AppenderRef ref="HTTP_LOG"/>
> > </Logger>
> > 
> > 
> > 
> > I'm logging correctly into another log files using identical 
> > configuration ... What's wrong in this log4j2 configuration?
> > 
> > I have executed this test several times (request with 3 hotels) ...
> > it
> > seems to always stop after reading more than (or around) 64K of 
> > data.
> > 
> > If I could debug I would be able to give more information.
> > 
> 
> Hi Joan
> 
> I will not be able to do much without a context / wire log or a test 
> application reproducing the issue.
> 
> Oleg
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
> For additional commands, e-mail: httpclient-users-help@hc.apache.org
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
> For additional commands, e-mail: httpclient-users-help@hc.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org




Re: Socket timeout exception with HttpClient5

Posted by Oleg Kalnichevski <ol...@apache.org>.
On Thu, 2019-04-04 at 20:08 +0200, Joan grupoventus wrote:
> Hi Oleg,
> 
> I will not be able to do much without a context / wire log or a test
> application reproducing the issue.
> 
> --> Yes, I am aware of this ... I'm getting crazy trying to log the
> http traffic, no success. That's why I was asking you if you saw
> something incorrect in our appender/logger config.
> 
> Is the logger name "org.apache.hc" right?

Yes, this looks correct as well as the rest of log4j2 config but I am
no log4j2 specialist.

Oleg

>  With HttpClient 4 I was using "org.apache.http.impl.conn" ,
> "org.apache.http.impl.client" and "org.apache.http.client".
> 
> Thanks,
> 
> Joan.
> 
> -----Original Message-----
> From: Oleg Kalnichevski [mailto:olegk@apache.org] 
> Sent: Thursday, April 4, 2019 7:56 PM
> To: HttpClient User Discussion <ht...@hc.apache.org>
> Subject: Re: Socket timeout exception with HttpClient5
> 
> On Thu, 2019-04-04 at 16:20 +0200, joan.balaguero@grupoventus.com
> wrote:
> > Hello Oleg,
> > 
> > I've come across with the following issue. Our application is 
> > contacting with a webservice that returns information about the 
> > requested hotels.
> > More hotels in the request, bigger the response size. This issue 
> > happens using both https or http.
> > 
> > Below the results of the test using curl, httpAsync 4.1.3 and
> > httpclient5-5.0-beta3 with httpcore5-5.0-beta6 (all tests executed
> > on 
> > the same server):
> > 
> > 1) Using curl:
> > 
> > 1 hotel -> 200 OK : 37K : 1.2s
> > 2 hotels --> 200 OK : 74K : 1.4s
> > 3 hotels --> 200 OK : 102K : 1.5s
> > 
> > 
> > 2) Using HttpAsync 4.1.3:
> > 
> > 1 hotel -> 200 OK : 37K : 1.2s
> > 2 hotels --> 200 OK : 74K : 1.4s
> > 3 hotels --> 200 OK : 102K : 1.5s
> > 
> > 
> > 3) Using HttpClient5:
> > 
> > 1 hotel -> 200 OK : 37K : 1.3s
> > 2 hotels --> Socket Timeout
> > 3 hotels --> Socket Timeout
> > 
> > 
> > The socket timeout error trace is:
> > 
> > java.net.SocketTimeoutException: 15,000 MILLISECONDS
> >          at
> > 
> 
> ...
> 
> > I'm trying to debug, but I'm not able to log anything into the
> > http 
> > client log. The log file is created but nothing is logged. I'm
> > using 
> > log4j2 in this way:
> > 
> > <!-- HTTP log for debug purposes -->
> > <File name="HTTP_LOG" fileName="${sys:log.dir}httpClient5.log" 
> > append="true" immediateFlush="true">
> > <PatternLayout>
> > <Pattern>%m%n</Pattern>
> > </PatternLayout>
> > </File>
> > 
> > <!-- HTTP enable logging -->
> > <Logger name="org.apache.hc" level="debug" includeLocation="false" 
> > additivity="false">
> > <AppenderRef ref="HTTP_LOG"/>
> > </Logger>
> > 
> > 
> > 
> > I'm logging correctly into another log files using identical 
> > configuration ... What's wrong in this log4j2 configuration?
> > 
> > I have executed this test several times (request with 3 hotels) ...
> > it 
> > seems to always stop after reading more than (or around) 64K of
> > data.
> > 
> > If I could debug I would be able to give more information.
> > 
> 
> Hi Joan
> 
> I will not be able to do much without a context / wire log or a test
> application reproducing the issue.
> 
> Oleg
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
> For additional commands, e-mail: httpclient-users-help@hc.apache.org
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
> For additional commands, e-mail: httpclient-users-help@hc.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org


RE: Socket timeout exception with HttpClient5

Posted by Joan grupoventus <jo...@grupoventus.com>.
Hi Oleg,

I will not be able to do much without a context / wire log or a test application reproducing the issue.

--> Yes, I am aware of this ... I'm getting crazy trying to log the http traffic, no success. That's why I was asking you if you saw something incorrect in our appender/logger config.

Is the logger name "org.apache.hc" right? With HttpClient 4 I was using "org.apache.http.impl.conn" , "org.apache.http.impl.client" and "org.apache.http.client".

Thanks,

Joan.

-----Original Message-----
From: Oleg Kalnichevski [mailto:olegk@apache.org] 
Sent: Thursday, April 4, 2019 7:56 PM
To: HttpClient User Discussion <ht...@hc.apache.org>
Subject: Re: Socket timeout exception with HttpClient5

On Thu, 2019-04-04 at 16:20 +0200, joan.balaguero@grupoventus.com
wrote:
> Hello Oleg,
> 
> I've come across with the following issue. Our application is 
> contacting with a webservice that returns information about the 
> requested hotels.
> More hotels in the request, bigger the response size. This issue 
> happens using both https or http.
> 
> Below the results of the test using curl, httpAsync 4.1.3 and
> httpclient5-5.0-beta3 with httpcore5-5.0-beta6 (all tests executed on 
> the same server):
> 
> 1) Using curl:
> 
> 1 hotel -> 200 OK : 37K : 1.2s
> 2 hotels --> 200 OK : 74K : 1.4s
> 3 hotels --> 200 OK : 102K : 1.5s
> 
> 
> 2) Using HttpAsync 4.1.3:
> 
> 1 hotel -> 200 OK : 37K : 1.2s
> 2 hotels --> 200 OK : 74K : 1.4s
> 3 hotels --> 200 OK : 102K : 1.5s
> 
> 
> 3) Using HttpClient5:
> 
> 1 hotel -> 200 OK : 37K : 1.3s
> 2 hotels --> Socket Timeout
> 3 hotels --> Socket Timeout
> 
> 
> The socket timeout error trace is:
> 
> java.net.SocketTimeoutException: 15,000 MILLISECONDS
>          at
> 

...

> I'm trying to debug, but I'm not able to log anything into the http 
> client log. The log file is created but nothing is logged. I'm using 
> log4j2 in this way:
> 
> <!-- HTTP log for debug purposes -->
> <File name="HTTP_LOG" fileName="${sys:log.dir}httpClient5.log" 
> append="true" immediateFlush="true">
> <PatternLayout>
> <Pattern>%m%n</Pattern>
> </PatternLayout>
> </File>
> 
> <!-- HTTP enable logging -->
> <Logger name="org.apache.hc" level="debug" includeLocation="false" 
> additivity="false">
> <AppenderRef ref="HTTP_LOG"/>
> </Logger>
> 
> 
> 
> I'm logging correctly into another log files using identical 
> configuration ... What's wrong in this log4j2 configuration?
> 
> I have executed this test several times (request with 3 hotels) ...
> it 
> seems to always stop after reading more than (or around) 64K of data.
> 
> If I could debug I would be able to give more information.
> 

Hi Joan

I will not be able to do much without a context / wire log or a test
application reproducing the issue.

Oleg



---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org


Re: Socket timeout exception with HttpClient5

Posted by Oleg Kalnichevski <ol...@apache.org>.
On Thu, 2019-04-04 at 16:20 +0200, joan.balaguero@grupoventus.com
wrote:
> Hello Oleg,
> 
> I've come across with the following issue. Our application is
> contacting 
> with a webservice that returns information about the requested
> hotels.
> More hotels in the request, bigger the response size. This issue
> happens 
> using both https or http.
> 
> Below the results of the test using curl, httpAsync 4.1.3 and 
> httpclient5-5.0-beta3 with httpcore5-5.0-beta6 (all tests executed
> on 
> the same server):
> 
> 1) Using curl:
> 
> 1 hotel -> 200 OK : 37K : 1.2s
> 2 hotels --> 200 OK : 74K : 1.4s
> 3 hotels --> 200 OK : 102K : 1.5s
> 
> 
> 2) Using HttpAsync 4.1.3:
> 
> 1 hotel -> 200 OK : 37K : 1.2s
> 2 hotels --> 200 OK : 74K : 1.4s
> 3 hotels --> 200 OK : 102K : 1.5s
> 
> 
> 3) Using HttpClient5:
> 
> 1 hotel -> 200 OK : 37K : 1.3s
> 2 hotels --> Socket Timeout
> 3 hotels --> Socket Timeout
> 
> 
> The socket timeout error trace is:
> 
> java.net.SocketTimeoutException: 15,000 MILLISECONDS
>          at 
> 

...

> I'm trying to debug, but I'm not able to log anything into the http 
> client log. The log file is created but nothing is logged. I'm using 
> log4j2 in this way:
> 
> <!-- HTTP log for debug purposes -->
> <File name="HTTP_LOG" fileName="${sys:log.dir}httpClient5.log" 
> append="true" immediateFlush="true">
> <PatternLayout>
> <Pattern>%m%n</Pattern>
> </PatternLayout>
> </File>
> 
> <!-- HTTP enable logging -->
> <Logger name="org.apache.hc" level="debug" includeLocation="false" 
> additivity="false">
> <AppenderRef ref="HTTP_LOG"/>
> </Logger>
> 
> 
> 
> I'm logging correctly into another log files using identical 
> configuration ... What's wrong in this log4j2 configuration?
> 
> I have executed this test several times (request with 3 hotels) ...
> it 
> seems to always stop after reading more than (or around) 64K of data.
> 
> If I could debug I would be able to give more information.
> 

Hi Joan

I will not be able to do much without a context / wire log or a test
application reproducing the issue.

Oleg



---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org