Hi,

We're still trying to put together a concise example but have determined some information and a work-around. Here's the scenario that happens:

Thread:
Start-up : Creates the Http connection; This starts an IO Dispatcher 3 thread and a pool-41-thread-1 (for example). The Http request is now issued

pool-41-thread-1: Gets the error (timeout or connection closed by peer). This Http request is retried
pool-41-thread-1:  Gets the error again; The operation is retried again.
pool-41-thread-1: Gets the error again; The connection is closed (hangs here)

I've added code to perform the connection close on a new worker thread when the error occurs instead of closing the connection in the "pool-41-thread-1" thread. The hang does not occur in this case.

In our test program, it executes AbstractMultiworkerIOReactor.doShutdown() as part of the client close. In the testing with our larger application, this does not appear to be called during the client close (when done on the "pool-41-thread-1" thread).

Are we doing something here that isn't correct?

Thanks in advance for any ideas.

Mark


On 1/25/2016 9:26 AM, Oleg Kalnichevski wrote:
On Fri, 2016-01-22 at 17:06 -0600, Mark Johnson wrote:
Hi,

I'm getting a hang in an application using the Async Client.  Here's
what's going on:

The application issues an HTTPS request to a host and gets an error
(timeout or other).  The operation is retried a couple of times just to
make sure.  After a couple of failures, we try to close the connection.
This is where it hangs.

I've done a thread dump of the application and it appears as this:

"pool-1497-thread-1" prio=10 tid=0x00002ba035214000 nid=0x1099 in
Object.wait() [0x00002ba05079a000]
     java.lang.Thread.State: WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
at java.lang.Thread.join(Unknown Source)
- locked <0x0000000528d668e8> (a java.lang.Thread)
at java.lang.Thread.join(Unknown Source)
at
org.apache.http.impl.nio.client.CloseableHttpAsyncClientBase.close(CloseableHttpAsyncClientBase.java:104)
at
com.servicemesh.io.http.impl.DefaultHttpClient.close(DefaultHttpClient.java:181)

I've also reproduced this in Eclipse and found the thread at the same
condition.  The code appears to be:

Hi Mark

Can this issue be reproduced with a test case?

Oleg


---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscr...@hc.apache.org
For additional commands, e-mail: httpclient-users-h...@hc.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscr...@hc.apache.org
For additional commands, e-mail: httpclient-users-h...@hc.apache.org

Reply via email to