[
https://issues.apache.org/jira/browse/HTTPASYNC-41?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13661005#comment-13661005
]
Oleg Kalnichevski commented on HTTPASYNC-41:
--------------------------------------------
Joshua,
HttpAsyncClient instances are thread-safe and could be (and should be) used by
multiple threads, or in your case I guess by multiple actors.
The first exception can only occur when an attempt is made to execute a request
with HttpAsyncClient that has not been fully started. The second exception can
only occur when an attempt is made to execute a request with HttpAsyncClient
that has already been shut down. This makes me suspect that there is likely to
be some sort of state management problem in your code. Could you please
double-check that?
Oleg
PS: I am going to be on holidays until next Sunday and most likely will be
off-line until then.
> Possible Multithreading issue (when used with Akka?)
> ----------------------------------------------------
>
> Key: HTTPASYNC-41
> URL: https://issues.apache.org/jira/browse/HTTPASYNC-41
> Project: HttpComponents HttpAsyncClient
> Issue Type: Bug
> Affects Versions: 4.0-beta4
> Environment: Linux
> Reporter: Joshua Andrews
> Priority: Minor
>
> I'm not sure if this a bug or just me doing something wrong.
> I have actor instances, that execute a request with a future for setting some
> state - real simple stuff. It works great when I have 1 Session, but as soon
> as I add another this happens.
> session starting
> session starting
> ERROR [org.apache.http.impl.nio.client.InternalHttpAsyncClient] 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:316)
> at
> org.apache.http.impl.nio.conn.PoolingNHttpClientConnectionManager.execute(PoolingNHttpClientConnectionManager.java:169)
> at
> org.apache.http.impl.nio.client.InternalHttpAsyncClient.doExecute(InternalHttpAsyncClient.java:101)
> at
> org.apache.http.impl.nio.client.InternalHttpAsyncClient.access$000(InternalHttpAsyncClient.java:56)
> at
> org.apache.http.impl.nio.client.InternalHttpAsyncClient$1.run(InternalHttpAsyncClient.java:91)
> ERROR [actors.Session] Request cannot be executed; I/O reactor status:
> SHUT_DOWN
> java.lang.IllegalStateException: Request cannot be executed; I/O reactor
> status: SHUT_DOWN
> at org.apache.http.util.Asserts.check(Asserts.java:40)
> at
> org.apache.http.impl.nio.client.InternalHttpAsyncClient.execute(InternalHttpAsyncClient.java:171)
> at
> org.apache.http.impl.nio.client.CloseableHttpAsyncClient.execute(CloseableHttpAsyncClient.java:63)
> at
> org.apache.http.impl.nio.client.CloseableHttpAsyncClient.execute(CloseableHttpAsyncClient.java:93)
> at
> org.apache.http.impl.nio.client.CloseableHttpAsyncClient.execute(CloseableHttpAsyncClient.java:78)
> at actors.FutureBridge$.bridge(bridge.scala:137)
> at actors.AsyncClient.POSTPayload(bridge.scala:296)
> at engines.MobileHelper$.getAuthToken(MobileHelper.scala:26)
> at actors.Session$$anonfun$receive$1.applyOrElse(Session.scala:92)
> at akka.actor.ActorCell.receiveMessage(ActorCell.scala:425)
> at akka.actor.ActorCell.invoke(ActorCell.scala:386)
> at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:230)
> at akka.dispatch.Mailbox.run(Mailbox.scala:212)
> at
> akka.dispatch.ForkJoinExecutorConfigurator$MailboxExecutionTask.exec(AbstractDispatcher.scala:506)
> at
> scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:262)
> at
> scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:975)
> at
> scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1478)
> at
> scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:104)
> Each actor creates its own instance of my actors.AsyncClient, which is
> basically just a wrapper around the apache client, and maps Java futures to
> akka futures, it does not support shutdown of the client at all.
> Any advice on how to debug this?
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]