You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by "Charles Barber (JIRA)" <ji...@apache.org> on 2014/11/26 04:19:12 UTC

[jira] [Commented] (HTTPASYNC-85) ZeroCopyConsumer Hangs on SSL Download

    [ https://issues.apache.org/jira/browse/HTTPASYNC-85?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14225649#comment-14225649 ] 

Charles Barber commented on HTTPASYNC-85:
-----------------------------------------

Just to clarify, when it hangs, it is after successfully connecting / TLS handshake, downloading the header, and downloading part of the body. Always either 7859 or 7860 bytes of 11722 total expected (not including headers).

Here is jstack output from when it is hung (it's just waiting on the selectors):

2014-11-25 22:15:19
Full thread dump Java HotSpot(TM) 64-Bit Server VM (24.55-b03 mixed mode):

"Attach Listener" daemon prio=10 tid=0x000000000a496000 nid=0x6777 waiting on condition [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"I/O dispatcher 2" prio=10 tid=0x00002b6f9c235800 nid=0x63ba runnable [0x00002b6fa075b000]
   java.lang.Thread.State: RUNNABLE
	at sun.nio.ch.EPollArrayWrapper.epollWait(Native Method)
	at sun.nio.ch.EPollArrayWrapper.poll(EPollArrayWrapper.java:269)
	at sun.nio.ch.EPollSelectorImpl.doSelect(EPollSelectorImpl.java:79)
	at sun.nio.ch.SelectorImpl.lockAndDoSelect(SelectorImpl.java:87)
	- locked <0x00000005839f5a50> (a sun.nio.ch.Util$2)
	- locked <0x00000005839f5a40> (a java.util.Collections$UnmodifiableSet)
	- locked <0x00000005839f5928> (a sun.nio.ch.EPollSelectorImpl)
	at sun.nio.ch.SelectorImpl.select(SelectorImpl.java:98)
	at org.apache.http.impl.nio.reactor.AbstractIOReactor.execute(AbstractIOReactor.java:256)
	at org.apache.http.impl.nio.reactor.BaseIOReactor.execute(BaseIOReactor.java:105)
	at org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor$Worker.run(AbstractMultiworkerIOReactor.java:584)
	at java.lang.Thread.run(Thread.java:745)

"I/O dispatcher 1" prio=10 tid=0x00002b6f9c234800 nid=0x63b9 runnable [0x00002b6fa065a000]
   java.lang.Thread.State: RUNNABLE
	at sun.nio.ch.EPollArrayWrapper.epollWait(Native Method)
	at sun.nio.ch.EPollArrayWrapper.poll(EPollArrayWrapper.java:269)
	at sun.nio.ch.EPollSelectorImpl.doSelect(EPollSelectorImpl.java:79)
	at sun.nio.ch.SelectorImpl.lockAndDoSelect(SelectorImpl.java:87)
	- locked <0x00000005839f4d88> (a sun.nio.ch.Util$2)
	- locked <0x00000005839f4d78> (a java.util.Collections$UnmodifiableSet)
	- locked <0x00000005839f4c60> (a sun.nio.ch.EPollSelectorImpl)
	at sun.nio.ch.SelectorImpl.select(SelectorImpl.java:98)
	at org.apache.http.impl.nio.reactor.AbstractIOReactor.execute(AbstractIOReactor.java:256)
	at org.apache.http.impl.nio.reactor.BaseIOReactor.execute(BaseIOReactor.java:105)
	at org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor$Worker.run(AbstractMultiworkerIOReactor.java:584)
	at java.lang.Thread.run(Thread.java:745)

"pool-1-thread-1" prio=10 tid=0x00002b6f9c208800 nid=0x63b8 runnable [0x00002b6fa0559000]
   java.lang.Thread.State: RUNNABLE
	at sun.nio.ch.EPollArrayWrapper.epollWait(Native Method)
	at sun.nio.ch.EPollArrayWrapper.poll(EPollArrayWrapper.java:269)
	at sun.nio.ch.EPollSelectorImpl.doSelect(EPollSelectorImpl.java:79)
	at sun.nio.ch.SelectorImpl.lockAndDoSelect(SelectorImpl.java:87)
	- locked <0x0000000582885f68> (a sun.nio.ch.Util$2)
	- locked <0x0000000582885ee8> (a java.util.Collections$UnmodifiableSet)
	- locked <0x0000000582885b40> (a sun.nio.ch.EPollSelectorImpl)
	at sun.nio.ch.SelectorImpl.select(SelectorImpl.java:98)
	at org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor.execute(AbstractMultiworkerIOReactor.java:340)
	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:745)

"Service Thread" daemon prio=10 tid=0x00002b6f50006800 nid=0x63ae runnable [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"C2 CompilerThread1" daemon prio=10 tid=0x00002b6f50004000 nid=0x63ad waiting on condition [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"C2 CompilerThread0" daemon prio=10 tid=0x00002b6f50001000 nid=0x63ac waiting on condition [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"Signal Dispatcher" daemon prio=10 tid=0x000000000a2ce800 nid=0x63ab runnable [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"Finalizer" daemon prio=10 tid=0x000000000a2af000 nid=0x63aa in Object.wait() [0x00002b6f98007000]
   java.lang.Thread.State: WAITING (on object monitor)
	at java.lang.Object.wait(Native Method)
	- waiting on <0x0000000581b05568> (a java.lang.ref.ReferenceQueue$Lock)
	at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:135)
	- locked <0x0000000581b05568> (a java.lang.ref.ReferenceQueue$Lock)
	at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:151)
	at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:189)

"Reference Handler" daemon prio=10 tid=0x000000000a2a5800 nid=0x63a9 in Object.wait() [0x00002b6f97f06000]
   java.lang.Thread.State: WAITING (on object monitor)
	at java.lang.Object.wait(Native Method)
	- waiting on <0x0000000581b050f0> (a java.lang.ref.Reference$Lock)
	at java.lang.Object.wait(Object.java:503)
	at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:133)
	- locked <0x0000000581b050f0> (a java.lang.ref.Reference$Lock)

"main" prio=10 tid=0x000000000a225000 nid=0x6395 in Object.wait() [0x00002b6f4111b000]
   java.lang.Thread.State: WAITING (on object monitor)
	at java.lang.Object.wait(Native Method)
	- waiting on <0x00000005834fd528> (a org.apache.http.concurrent.BasicFuture)
	at java.lang.Object.wait(Object.java:503)
	at org.apache.http.concurrent.BasicFuture.get(BasicFuture.java:75)
	- locked <0x00000005834fd528> (a org.apache.http.concurrent.BasicFuture)
	at sslhang.client.SimClient.runZeroCopyConsumerPost(SimClient.java:92)
	at sslhang.client.SimClient.main(SimClient.java:252)

"VM Thread" prio=10 tid=0x000000000a2a3000 nid=0x63a8 runnable 

"GC task thread#0 (ParallelGC)" prio=10 tid=0x000000000a23b000 nid=0x6396 runnable 

"GC task thread#1 (ParallelGC)" prio=10 tid=0x000000000a23c800 nid=0x6397 runnable 

"GC task thread#2 (ParallelGC)" prio=10 tid=0x000000000a23e800 nid=0x6398 runnable 

"GC task thread#3 (ParallelGC)" prio=10 tid=0x000000000a240800 nid=0x6399 runnable 

"GC task thread#4 (ParallelGC)" prio=10 tid=0x000000000a242800 nid=0x639a runnable 

"GC task thread#5 (ParallelGC)" prio=10 tid=0x000000000a244000 nid=0x639b runnable 

"GC task thread#6 (ParallelGC)" prio=10 tid=0x000000000a246000 nid=0x639c runnable 

"GC task thread#7 (ParallelGC)" prio=10 tid=0x000000000a248000 nid=0x639d runnable 

"GC task thread#8 (ParallelGC)" prio=10 tid=0x000000000a249800 nid=0x639e runnable 

"GC task thread#9 (ParallelGC)" prio=10 tid=0x000000000a24b800 nid=0x639f runnable 

"GC task thread#10 (ParallelGC)" prio=10 tid=0x000000000a24d800 nid=0x63a0 runnable 

"GC task thread#11 (ParallelGC)" prio=10 tid=0x000000000a24f000 nid=0x63a1 runnable 

"GC task thread#12 (ParallelGC)" prio=10 tid=0x000000000a251000 nid=0x63a2 runnable 

"GC task thread#13 (ParallelGC)" prio=10 tid=0x000000000a253000 nid=0x63a3 runnable 

"GC task thread#14 (ParallelGC)" prio=10 tid=0x000000000a255000 nid=0x63a4 runnable 

"GC task thread#15 (ParallelGC)" prio=10 tid=0x000000000a256800 nid=0x63a5 runnable 

"GC task thread#16 (ParallelGC)" prio=10 tid=0x000000000a258800 nid=0x63a6 runnable 

"GC task thread#17 (ParallelGC)" prio=10 tid=0x000000000a25a800 nid=0x63a7 runnable 

"VM Periodic Task Thread" prio=10 tid=0x00002b6f50011800 nid=0x63af waiting on condition 

JNI global references: 247

> ZeroCopyConsumer Hangs on SSL Download
> --------------------------------------
>
>                 Key: HTTPASYNC-85
>                 URL: https://issues.apache.org/jira/browse/HTTPASYNC-85
>             Project: HttpComponents HttpAsyncClient
>          Issue Type: Bug
>    Affects Versions: 4.0.2
>         Environment: 2.6.18-398.el5 #1 SMP Tue Aug 12 06:26:17 EDT 2014 x86_64 GNU/Linux
> Red Hat Enterprise Linux Server release 5.11 (Tikanga)
> java version "1.7.0_55"
> Java(TM) SE Runtime Environment (build 1.7.0_55-b13)
> Java HotSpot(TM) 64-Bit Server VM (build 24.55-b03, mixed mode)
>            Reporter: Charles Barber
>         Attachments: DemoSSLHang.zip
>
>
> When using the ZeroCopyConsumer class, but only when the target server is accessed over TLS, certain requests will result in it hanging indefinitely (until the other side resets the connection or the client times out), or for a couple minutes and then continue.
> This happens consistently against a .Net server in one of our partner's environments. I've also seen it when accessing a WebLogic 11g server, but with that, it will resume on its own after a couple minutes. I cannot reproduce it with a Jetty server.
> If I set up stunnel to do the TLS, and run exactly the same requests over plain text HTTP, we experience no issues. This is in fact our production workaround.
> Also, using the basic in-memory consumer (over TLS) works fine. I also wrote a simple async consumer that reads from the decoder to an array-based byte buffer and then writes to a file, and that works fine.
> Interestingly, I have another custom async consumer that we use for streaming back out to the original client, while HTTP Async Client is running in a servlet 3.1 container, and that hangs just like the ZeroCopyConsumer does (but again, no issue over plain text HTTP).
> I'll attach a client that can reproduce the error; unfortunately I can't provide the servers in question.



--
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