Return-Path: X-Original-To: apmail-hc-dev-archive@www.apache.org Delivered-To: apmail-hc-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 9BFD71761C for ; Thu, 19 Nov 2015 15:56:11 +0000 (UTC) Received: (qmail 40237 invoked by uid 500); 19 Nov 2015 15:56:11 -0000 Delivered-To: apmail-hc-dev-archive@hc.apache.org Received: (qmail 40205 invoked by uid 500); 19 Nov 2015 15:56:11 -0000 Mailing-List: contact dev-help@hc.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "HttpComponents Project" Delivered-To: mailing list dev@hc.apache.org Received: (qmail 40100 invoked by uid 99); 19 Nov 2015 15:56:11 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 19 Nov 2015 15:56:11 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 413722C1F5E for ; Thu, 19 Nov 2015 15:56:11 +0000 (UTC) Date: Thu, 19 Nov 2015 15:56:11 +0000 (UTC) From: "Dominique Mongelli (JIRA)" To: dev@hc.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HTTPCORE-414) HTTP Connection closed when polling an API every 5 seconds MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HTTPCORE-414?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15013739#comment-15013739 ] Dominique Mongelli commented on HTTPCORE-414: --------------------------------------------- Hi Oleg, Let me confirm that with the API provider. Thanks for your support. Regards, Dominique > HTTP Connection closed when polling an API every 5 seconds > ---------------------------------------------------------- > > Key: HTTPCORE-414 > URL: https://issues.apache.org/jira/browse/HTTPCORE-414 > Project: HttpComponents HttpCore > Issue Type: Bug > Components: HttpCore NIO > Affects Versions: 4.4.4 > Environment: OS : Linux Ubuntu 14.04 LTS > Software : Java 1.8 > Java source code available at the following link : > https://gist.github.com/dominiquemongelli/34e3588c5a1436276dff#file-httpcoreniosample > The java program uses the following libraries : > - httpclient 4.5.1 > - httpcore-nio 4.4.4 > - httpasyncclient 4.1 > - httpcore 4.4.4 > Reporter: Dominique Mongelli > Priority: Minor > Labels: connectionclosed, http, http304, httpcore > > 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 : > {code:title=|borderStyle=solid} > 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) > {code} > 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 : > {code:title= |borderStyle=solid} > Thread.sleep(POLLING_FREQUENCY_IN_MS); > {code} > - 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. -- This message was sent by Atlassian JIRA (v6.3.4#6332) --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org For additional commands, e-mail: dev-help@hc.apache.org