Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 95611200CB6 for ; Thu, 29 Jun 2017 17:48:04 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 93C17160BDF; Thu, 29 Jun 2017 15:48:04 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id B42AF160BED for ; Thu, 29 Jun 2017 17:48:03 +0200 (CEST) Received: (qmail 41186 invoked by uid 500); 29 Jun 2017 15:48:02 -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 41175 invoked by uid 99); 29 Jun 2017 15:48:02 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 29 Jun 2017 15:48:02 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 7E8C9C319C for ; Thu, 29 Jun 2017 15:48:02 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -99.21 X-Spam-Level: X-Spam-Status: No, score=-99.21 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01, URIBL_BLOCKED=0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id dCqBJbJ9ekJA for ; Thu, 29 Jun 2017 15:48:01 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id 4EC7260E39 for ; Thu, 29 Jun 2017 15:48:01 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id B74E3E0DA7 for ; Thu, 29 Jun 2017 15:48:00 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 20939245BA for ; Thu, 29 Jun 2017 15:48:00 +0000 (UTC) Date: Thu, 29 Jun 2017 15:48:00 +0000 (UTC) From: "James Beckett (JIRA)" To: dev@hc.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HTTPASYNC-104) IlligalStateException when using the same client for mutiple requests. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Thu, 29 Jun 2017 15:48:04 -0000 [ https://issues.apache.org/jira/browse/HTTPASYNC-104?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16068502#comment-16068502 ] James Beckett commented on HTTPASYNC-104: ----------------------------------------- I've seen this very recently *on Linux* with HttpAsyncClient 4.1, and it _appears_ to be due to an hours-earlier OOM error (heap exhaustion) unrelated to HttpComponents; several other components failed relatively gracefully, where HttpAsyncClient went into this sticky failure state. To be fair, that might be the most graceful thing it can do, but perhaps the documentation could reflect a way of detecting the state and recovering, if it can't be made to recover automatically. Would the {{isRunning()}} and {{start()}} methods be appropriate for this (on CloseableHttpAsyncClient)? Additionally, should the case be reported via the {{FutureCallback<>}}'s {{failed(Exception ex)}} instead of being thrown by {{execute()}}, which might allow for less intrusive handling? (In my case, the AsyncClient is being used via a third party class ([Elasticsearch RESTClient|https://www.elastic.co/guide/en/elasticsearch/client/java-rest/current/index.html]) which would likely require them to make any such changes) {code} 2017-06-23 20:41:35.765 ERROR 20131 ... OOM somewhere between here and 2017-06-23 21:35:58.412 ERROR 20131 ... here 2017-06-24 00:59:39.016 ERROR 20131 --- [-8080-exec-2877] (...) due to exception [Request cannot be executed; I/O reactor status: STOPPED] java.lang.IllegalStateException: Request cannot be executed; I/O reactor status: STOPPED at org.apache.http.util.Asserts.check(Asserts.java:46) ~[httpcore-4.4.6.jar:4.4.6] at org.apache.http.impl.nio.client.CloseableHttpAsyncClientBase.ensureRunning(CloseableHttpAsyncClientBase.java:90) ~[httpasyncclient-4.1.jar:4.1] at org.apache.http.impl.nio.client.InternalHttpAsyncClient.execute(InternalHttpAsyncClient.java:123) ~[httpasyncclient-4.1.jar:4.1] at org.apache.http.impl.nio.client.CloseableHttpAsyncClient.execute(CloseableHttpAsyncClient.java:67) ~[httpasyncclient-4.1.jar:4.1] at org.elasticsearch.client.RestClient.performRequestAsync(RestClient.java:300) ~[rest-5.2.0.jar:5.2.0] at org.elasticsearch.client.RestClient.performRequestAsync(RestClient.java:290) ~[rest-5.2.0.jar:5.2.0] at org.elasticsearch.client.RestClient.performRequest(RestClient.java:211) ~[rest-5.2.0.jar:5.2.0] at org.elasticsearch.client.RestClient.performRequest(RestClient.java:184) ~[rest-5.2.0.jar:5.2.0] at org.elasticsearch.client.RestClient.performRequest(RestClient.java:163) ~[rest-5.2.0.jar:5.2.0] at (...).getConfig(...:222) ~[...] {code} > IlligalStateException when using the same client for mutiple requests. > ---------------------------------------------------------------------- > > Key: HTTPASYNC-104 > URL: https://issues.apache.org/jira/browse/HTTPASYNC-104 > Project: HttpComponents HttpAsyncClient > Issue Type: Bug > Affects Versions: 4.1.1 > Environment: JDK 1.6 > Reporter: maria deepak marneni > Attachments: eclipseOutput-1, eclipseOutput.txt, HttpAsyncResponseHandler.java, HttpRequestPublisherTester.java > > > In a multi thread environment where all requests use the same client. CloseableHttpAsyncClient throws illegalStateException when execute method is called. > Exception in thread "Thread-91" java.lang.IllegalStateException: Request cannot be executed; I/O reactor status: STOPPED > at org.apache.http.util.Asserts.check(Asserts.java:46) > at org.apache.http.impl.nio.client.CloseableHttpAsyncClientBase.ensureRunning(CloseableHttpAsyncClientBase.java:90) > at org.apache.http.impl.nio.client.InternalHttpAsyncClient.execute(InternalHttpAsyncClient.java:123) > at org.apache.http.impl.nio.client.CloseableHttpAsyncClient.execute(CloseableHttpAsyncClient.java:74) > at org.apache.http.impl.nio.client.CloseableHttpAsyncClient.execute(CloseableHttpAsyncClient.java:107) > at org.apache.http.impl.nio.client.CloseableHttpAsyncClient.execute(CloseableHttpAsyncClient.java:91) > at domain.hardware.http.HttpRequestPublisher1.execute(HttpRequestPublisherTester.java:282) > at domain.hardware.http.HttpHandler1.makeAsyncHttpGetRequest(HttpRequestPublisherTester.java:179) > at domain.hardware.http.HttpRequestPublisherTester.run(HttpRequestPublisherTester.java:48) > at java.lang.Thread.run(Thread.java:662) > Exception in thread "Thread-46" java.lang.IllegalStateException: Request cannot be executed; I/O reactor status: STOPPED > at org.apache.http.util.Asserts.check(Asserts.java:46) > at org.apache.http.impl.nio.client.CloseableHttpAsyncClientBase.ensureRunning(CloseableHttpAsyncClientBase.java:90) > at org.apache.http.impl.nio.client.InternalHttpAsyncClient.execute(InternalHttpAsyncClient.java:123) > at org.apache.http.impl.nio.client.CloseableHttpAsyncClient.execute(CloseableHttpAsyncClient.java:74) > at org.apache.http.impl.nio.client.CloseableHttpAsyncClient.execute(CloseableHttpAsyncClient.java:107) > at org.apache.http.impl.nio.client.CloseableHttpAsyncClient.execute(CloseableHttpAsyncClient.java:91) > at domain.hardware.http.HttpRequestPublisher1.execute(HttpRequestPublisherTester.java:282) > at domain.hardware.http.HttpHandler1.makeAsyncHttpGetRequest(HttpRequestPublisherTester.java:179) > at domain.hardware.http.HttpRequestPublisherTester.run(HttpRequestPublisherTester.java:48) > at java.lang.Thread.run(Thread.java:662) -- This message was sent by Atlassian JIRA (v6.4.14#64029) --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org For additional commands, e-mail: dev-help@hc.apache.org