jira-importer opened a new issue, #943:
URL: https://github.com/apache/httpcomponents-core/issues/943

   **[Dominique 
Mongelli](https://issues.apache.org/jira/secure/[email protected])**
 opened 
**[HTTPCORE-414](https://issues.apache.org/jira/browse/HTTPCORE-414?redirect=false)**
 and commented
   
   Scenario to reproduce the bug :
   - The java source code simulates 10 pollings on the following API  
http://www.typeunsafe.org/api/temperatures/69 (using httpasyncclient) with 5 
seconds polling frequency.
   - Compile and run the source code provided.
   - Current result : after some polling correctly done, the execution throws 
the following exception :
   
   ```
   Exception in thread "main" java.util.concurrent.ExecutionException: 
org.apache.http.ConnectionClosedException: Connection closed
        at org.apache.http.concurrent.BasicFuture.getResult(BasicFuture.java:70)
        at org.apache.http.concurrent.BasicFuture.get(BasicFuture.java:80)
        at HttpCoreSample.main(HttpCoreSample.java:31)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:483)
        at com.intellij.rt.execution.application.AppMain.main(AppMain.java:140)
   Caused by: org.apache.http.ConnectionClosedException: Connection closed
        at 
org.apache.http.nio.protocol.HttpAsyncRequestExecutor.endOfInput(HttpAsyncRequestExecutor.java:321)
        at 
org.apache.http.impl.nio.DefaultNHttpClientConnection.consumeInput(DefaultNHttpClientConnection.java:263)
        at 
org.apache.http.impl.nio.client.InternalIODispatch.onInputReady(InternalIODispatch.java:81)
        at 
org.apache.http.impl.nio.client.InternalIODispatch.onInputReady(InternalIODispatch.java:39)
        at 
org.apache.http.impl.nio.reactor.AbstractIODispatch.inputReady(AbstractIODispatch.java:116)
        at 
org.apache.http.impl.nio.reactor.BaseIOReactor.readable(BaseIOReactor.java:164)
        at 
org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvent(AbstractIOReactor.java:339)
        at 
org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvents(AbstractIOReactor.java:317)
        at 
org.apache.http.impl.nio.reactor.AbstractIOReactor.execute(AbstractIOReactor.java:278)
        at 
org.apache.http.impl.nio.reactor.BaseIOReactor.execute(BaseIOReactor.java:106)
        at 
org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor$Worker.run(AbstractMultiworkerIOReactor.java:590)
        at java.lang.Thread.run(Thread.java:745)
   ```
   
   Important things to mention :
   - The issue does not occur with another API (for example API 
https://api.bitcoinaverage.com/ticker/global/EUR/)
   - The issue is reproductible only with a 5 seconds polling frequency. If 
polling frequency is set to 10 seconds, then the issue is not reproductible 
anymore.
     The polling frequency can be updated via :
   
   ```
   Thread.sleep(POLLING_FREQUENCY_IN_MS);
   ```
   
   - The API uses within the source code 
(http://www.typeunsafe.org/api/temperatures/69) can return a 304 http status 
when no data has been updated.
   - The API uses a Varnish cache layer.
   
   
   
   ---
   
   **Affects:** 4.4.4
   
   **Remote Links:**
   - [httpcoresample java source code
   
](https://gist.github.com/dominiquemongelli/34e3588c5a1436276dff#file-httpcoreniosample)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to