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 55FC511599 for ; Tue, 13 May 2014 07:06:39 +0000 (UTC) Received: (qmail 18816 invoked by uid 500); 10 May 2014 22:06:28 -0000 Delivered-To: apmail-hc-dev-archive@hc.apache.org Received: (qmail 18327 invoked by uid 500); 10 May 2014 22:06:27 -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 18261 invoked by uid 99); 10 May 2014 22:06:27 -0000 Received: from Unknown (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 10 May 2014 22:06:26 +0000 Date: Sat, 10 May 2014 22:06:26 +0000 (UTC) From: "Jose Dillet (JIRA)" To: dev@hc.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HTTPASYNC-74) IllegalStateException when sharing the connection manager amongst HttpAsyncClient instances 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/HTTPASYNC-74?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13992616#comment-13992616 ] Jose Dillet commented on HTTPASYNC-74: -------------------------------------- I have tested the fix and it's working fine. wrt the API changes, is there any reason to have a setter with 2 params in the builder, instead of 2 setters? i.e. setConnectionManager(final NHttpClientConnectionManager connManager) setSharedConnectionManager(final boolean shared) instead of setConnectionManager(final NHttpClientConnectionManager connManager, final boolean shared) > IllegalStateException when sharing the connection manager amongst HttpAsyncClient instances > ------------------------------------------------------------------------------------------- > > Key: HTTPASYNC-74 > URL: https://issues.apache.org/jira/browse/HTTPASYNC-74 > Project: HttpComponents HttpAsyncClient > Issue Type: Bug > Affects Versions: 4.0.1 > Environment: JDK 1.7 > Reporter: Jose Dillet > Fix For: 4.1-alpha1 > > Attachments: SharedHttpAsyncClient.java > > > When several HttpAsyncClient instances share the same connection manager, IllegalStateException is thrown: > 15:23:10 ERROR - I/O reactor terminated abnormally > java.lang.IllegalStateException: Illegal state ACTIVE > at org.apache.http.util.Asserts.check(Asserts.java:40) > at org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor.execute(AbstractMultiworkerIOReactor.java:313) > at org.apache.http.impl.nio.conn.PoolingNHttpClientConnectionManager.execute(PoolingNHttpClientConnectionManager.java:189) > at org.apache.http.impl.nio.client.CloseableHttpAsyncClientBase.doExecute(CloseableHttpAsyncClientBase.java:67) > at org.apache.http.impl.nio.client.CloseableHttpAsyncClientBase.access$000(CloseableHttpAsyncClientBase.java:38) > at org.apache.http.impl.nio.client.CloseableHttpAsyncClientBase$1.run(CloseableHttpAsyncClientBase.java:57) > at java.lang.Thread.run(Thread.java:744) > GET http://www.apache.org/ HTTP/1.1->HTTP/1.1 200 OK > Exception in thread "main" java.lang.IllegalStateException: Request cannot be executed; I/O reactor status: STOPPED > at org.apache.http.util.Asserts.check(Asserts.java:40) > at org.apache.http.impl.nio.client.InternalHttpAsyncClient.execute(InternalHttpAsyncClient.java:112) > at org.apache.http.impl.nio.client.CloseableHttpAsyncClient.execute(CloseableHttpAsyncClient.java:72) > at org.apache.http.impl.nio.client.CloseableHttpAsyncClient.execute(CloseableHttpAsyncClient.java:102) > at org.apache.http.impl.nio.client.CloseableHttpAsyncClient.execute(CloseableHttpAsyncClient.java:87) > at org.apache.http.examples.nio.client.SharedHttpAsyncClient2.makeRequest(SharedHttpAsyncClient2.java:51) > at org.apache.http.examples.nio.client.SharedHttpAsyncClient2.main(SharedHttpAsyncClient2.java:40) -- This message was sent by Atlassian JIRA (v6.2#6252) --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org For additional commands, e-mail: dev-help@hc.apache.org