users@glassfish.java.net

Re: Uploading large files via POST Request hangs httpWorkerThreads

From: <glassfish_at_javadesktop.org>
Date: Wed, 23 Sep 2009 16:06:07 PDT

Hi Jeanfrancois,

The threads get stuck permanently. Below is a stacktrace obtained for jconsole for one of the stuck threads. Many of the stuck threads are showing the same stack, but there are several variations as well -- all related to SSL.

Whenever we see a stuck thread, it does coincide with a debug message of ours that does indeed show the number of bytes being read not matching that Content-Length. Originally it appeared to be happening only with files > 180k but now we are seeing it even on smaller files.

Unfortunately, the client and server applications exhibiting this problem are not easily ripped out of their environment. On top of that we are using embedded-glassfish to run the application server which makes it even harder to debug since the embedded-glassfish api is apparently going through a major rewrite for v3 and has lots of missing pieces as of yet.

joey

------------
Name: httpWorkerThread-8282-8
State: RUNNABLE
Total blocked: 188 Total waited: 1

Stack trace:
com.sun.net.ssl.internal.ssl.SSLEngineImpl.unwrap(SSLEngineImpl.java:665)
javax.net.ssl.SSLEngine.unwrap(SSLEngine.java:607)
com.sun.grizzly.util.SSLUtils.unwrap(SSLUtils.java:257)
com.sun.grizzly.util.SSLUtils.unwrapAll(SSLUtils.java:192)
com.sun.grizzly.util.SSLUtils.doSecureRead(SSLUtils.java:114)
com.sun.grizzly.util.InputReader.doSecureRead(InputReader.java:273)
com.sun.grizzly.util.InputReader.doRead(InputReader.java:256)
com.sun.grizzly.util.InputReader.read(InputReader.java:188)
com.sun.grizzly.tcp.http11.InternalInputBuffer.fill(InternalInputBuffer.java:776)
com.sun.grizzly.tcp.http11.InternalInputBuffer$InputStreamInputBuffer.doRead(InternalInputBuffer.java:805)
com.sun.grizzly.tcp.http11.filters.IdentityInputFilter.end(IdentityInputFilter.java:198)
com.sun.grizzly.tcp.http11.InternalInputBuffer.endRequest(InternalInputBuffer.java:379)
com.sun.grizzly.http.DefaultProcessorTask.postResponse(DefaultProcessorTask.java:593)
com.sun.grizzly.http.DefaultProcessorTask.doProcess(DefaultProcessorTask.java:571)
com.sun.grizzly.http.DefaultProcessorTask.process(DefaultProcessorTask.java:827)
com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:152)
com.sun.enterprise.v3.services.impl.GlassfishProtocolChain.executeProtocolFilter(GlassfishProtocolChain.java:71)
com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:103)
com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:89)
com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:76)
com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:67)
com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:56)
com.sun.grizzly.util.WorkerThreadImpl.processTask(WorkerThreadImpl.java:325)
com.sun.grizzly.util.WorkerThreadImpl.run(WorkerThreadImpl.java:184)
[Message sent by forum member 'joey_cadence' (joey_at_cadence.com)]

http://forums.java.net/jive/thread.jspa?messageID=365392