Atmosphere/atmosphere — Issue #57: EMPTY_DESTROY -broadcasterLifeCyclePolicy causes error in grizzly
Author: cproinger
Created: 2011-11-10 17:14:17+00:00
State: open

hi jeanfrancois,

to make sure the problem in https://github.com/Atmosphere/atmosphere/issues/43, is not from jetty i tried to use grizzly. The problem is with the bc-lifecycle-policy set to BroadcasterLifeCyclePolicy.ATMOSPHERE_RESOURCE_POLICY.EMPTY_DESTROY
none of my @Supend-requests work. heres my stracktrace, somehow the resume fails which causes the connection to close. (the second part is my client-stacktrace from com.ning AsyncHttpClient)

i tested this with 0.8.0-RC2 and 0.8.0-RC3

08.11.2011 01:32:37 com.sun.grizzly.http.ProcessorTask terminateProcess
WARNUNG: GRIZZLY0024: Terminate process interrupted.
java.lang.InterruptedException
at java.util.concurrent.locks.AbstractQueuedSynchronizer.tryAcquireSharedNanos(AbstractQueuedSynchronizer.java:1302)
at java.util.concurrent.Semaphore.tryAcquire(Semaphore.java:383)
at com.sun.grizzly.http.ProcessorTask.terminateProcess(ProcessorTask.java:978)
at com.sun.grizzly.arp.DefaultAsyncExecutor.finishResponse(DefaultAsyncExecutor.java:186)
at com.sun.grizzly.arp.DefaultAsyncExecutor.finishExecute(DefaultAsyncExecutor.java:210)
at com.sun.grizzly.arp.AsyncProcessorTask.doTask(AsyncProcessorTask.java:119)
at com.sun.grizzly.comet.CometEngine.flushPostExecute(CometEngine.java:411)
at com.sun.grizzly.comet.CometEngine.interrupt0(CometEngine.java:393)
at com.sun.grizzly.comet.CometEngine.interrupt(CometEngine.java:371)
at com.sun.grizzly.comet.CometContext.resumeCometHandler(CometContext.java:435)
at org.atmosphere.container.GrizzlyCometSupport.resume(GrizzlyCometSupport.java:160)
at org.atmosphere.container.GrizzlyCometSupport.action(GrizzlyCometSupport.java:172)
at org.atmosphere.container.GrizzlyCometSupport.action(GrizzlyCometSupport.java:65)
at org.atmosphere.cpr.AtmosphereResourceImpl.resume(AtmosphereResourceImpl.java:209)
at org.atmosphere.jersey.util.JerseyBroadcasterUtil.broadcast(JerseyBroadcasterUtil.java:93)
at org.atmosphere.jersey.JerseyBroadcaster.broadcast(JerseyBroadcaster.java:58)
at org.atmosphere.cpr.DefaultBroadcaster.executeAsyncWrite(DefaultBroadcaster.java:601)
at org.atmosphere.cpr.DefaultBroadcaster$3.run(DefaultBroadcaster.java:626)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)

01:32:37.428 [New I/O client worker #2-6] ERROR o.m.web.AtmosphereWebSender - error with async-request
java.io.IOException: Remotely Closed [id: 0x003c40f0, /127.0.0.1:57952 :> localhost/127.0.0.1:9881]
at com.ning.http.client.providers.netty.NettyAsyncHttpProvider.channelClosed(NettyAsyncHttpProvider.java:1514) [async-http-client-1.6.5.jar:na]
at org.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:98) [netty-3.2.5.Final.jar:na]
at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564) [netty-3.2.5.Final.jar:na]
at org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:783) [netty-3.2.5.Final.jar:na]
at org.jboss.netty.handler.stream.ChunkedWriteHandler.handleUpstream(ChunkedWriteHandler.java:149) [netty-3.2.5.Final.jar:na]
at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564) [netty-3.2.5.Final.jar:na]
at org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:783) [netty-3.2.5.Final.jar:na]
at org.jboss.netty.handler.codec.replay.ReplayingDecoder.cleanup(ReplayingDecoder.java:554) [netty-3.2.5.Final.jar:na]
at org.jboss.netty.handler.codec.replay.ReplayingDecoder.channelClosed(ReplayingDecoder.java:455) [netty-3.2.5.Final.jar:na]
at org.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:98) [netty-3.2.5.Final.jar:na]
at org.jboss.netty.handler.codec.http.HttpClientCodec.handleUpstream(HttpClientCodec.java:77) [netty-3.2.5.Final.jar:na]
at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564) [netty-3.2.5.Final.jar:na]
at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:559) [netty-3.2.5.Final.jar:na]
at org.jboss.netty.channel.Channels.fireChannelClosed(Channels.java:404) [netty-3.2.5.Final.jar:na]
at org.jboss.netty.channel.socket.nio.NioWorker.close(NioWorker.java:600) [netty-3.2.5.Final.jar:na]
at org.jboss.netty.channel.socket.nio.NioWorker.read(NioWorker.java:356) [netty-3.2.5.Final.jar:na]
at org.jboss.netty.channel.socket.nio.NioWorker.processSelectedKeys(NioWorker.java:280) [netty-3.2.5.Final.jar:na]
at org.jboss.netty.channel.socket.nio.NioWorker.run(NioWorker.java:200) [netty-3.2.5.Final.jar:na]
at org.jboss.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:108) [netty-3.2.5.Final.jar:na]
at org.jboss.netty.util.internal.DeadLockProofWorker$1.run(DeadLockProofWorker.java:44) [netty-3.2.5.Final.jar:na]
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [na:1.6.0_23-ea]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [na:1.6.0_23-ea]
at java.lang.Thread.run(Thread.java:619) [na:1.6.0_23-ea]

i basically setup the grizzly server the same way as in your test-class: https://github.com/jfarcand/atmosphere/blob/master/modules/jersey/src/test/java/org/atmosphere/jersey/tests/BaseGrizzyTest.java

kind regards,
Christian