users@grizzly.java.net

Re: "Broken Pipe" and "client is busy or timeout" errors

From: Oleksiy Stashok <oleksiy.stashok_at_oracle.com>
Date: Mon, 28 Mar 2011 13:24:49 -0700

Hi William,

pls. try to increase the keep-alive timeout-in-seconds attr [1] in the
GF domain.xml file, make it much bigger and check if you still have
exception coming.

> I am using a concurrent comet handler because I use comet in a streaming
> mode. I have just modified the DefaultConcurrentCometHandler in order to
> give a limite a message send by one thread. The comet handler keep a
> reference on the httpresponse from the comet servlet when the user register.
>
> I am using grizzly 1.0.39 in glassfish v2.
>
> I have read some pieces of code and actually I see that the second exception
> is due to a timeout on a selector.select() that took too much time. Just for
> my understanding, did a call to the select method really send the data to
> the remote client ?
channel.write() sends them, selector.select() just listens for
channel(s) I/O events and wakes up if any is available for processing.

> So, in order to try to fix my issues I have to know if they are due to
> grizzly internal logic (or my logic around grizzly) or due to netwrok
> settings that are not properly set.
Difficult to say, let's try to increase timeout and see.
If it doesn't work, can you pls. provide a simple testcase so we can
take a look at?

Thanks.

WBR,
Alexey.

[1]
<keep-alive max-connections="250" thread-count="1" timeout-in-seconds="30"/>


> Does anyone can help me ?
>
> Thanks.
>
> William.
>
>
> Stack Trace :
>
> ClientAbortException: java.io.IOException: Broken pipe
> at
> org.apache.coyote.tomcat5.OutputBuffer.doFlush(OutputBuffer.java:386)
> at
> org.apache.coyote.tomcat5.OutputBuffer.flush(OutputBuffer.java:352)
> at
> org.apache.coyote.tomcat5.CoyoteOutputStream.flush(CoyoteOutputStream.java:176)
> at sun.nio.cs.StreamEncoder.implFlush(StreamEncoder.java:278)
> at sun.nio.cs.StreamEncoder.flush(StreamEncoder.java:122)
> at java.io.OutputStreamWriter.flush(OutputStreamWriter.java:212)
> at
> com.big.comet.GrizzlyCometHandler.doWrite0(GrizzlyCometHandler.java:111)
> at
> com.big.comet.GrizzlyCometHandler.doWrite(GrizzlyCometHandler.java:90)
> at
> com.big.comet.GrizzlyCometHandler.writeEvent(GrizzlyCometHandler.java:99)
> at
> com.big.comet.GrizzlyCometHandler.onEvent(GrizzlyCometHandler.java:129)
> at
> com.big.comet.concurrent.GrizzlyConcurrentCometHandler.onEvent(GrizzlyConcurrentCometHandler.java:188)
> at
> com.big.comet.concurrent.ConcurrentNotificationHandler.notify0(ConcurrentNotificationHandler.java:35)
> at
> com.sun.enterprise.web.connector.grizzly.comet.DefaultNotificationHandler.notify(DefaultNotificationHandler.java:149)
> at
> com.sun.enterprise.web.connector.grizzly.comet.CometContext.notify(CometContext.java:553)
> at
> com.big.comet.GrizzlyMessageDispatcher$1.sendMessageToClient(GrizzlyMessageDispatcher.java:817)
> at
> com.big.comet.GrizzlyMessageDispatcher$1.run(GrizzlyMessageDispatcher.java:806)
> 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)
> Caused by: java.io.IOException: Broken pipe
> at sun.nio.ch.FileDispatcher.write0(Native Method)
> at sun.nio.ch.SocketDispatcher.write(SocketDispatcher.java:29)
> at sun.nio.ch.IOUtil.writeFromNativeBuffer(IOUtil.java:100)
> at sun.nio.ch.IOUtil.write(IOUtil.java:71)
> at sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:334)
> at
> com.sun.enterprise.web.connector.grizzly.OutputWriter.flushChannel(OutputWriter.java:92)
> at
> com.sun.enterprise.web.connector.grizzly.OutputWriter.flushChannel(OutputWriter.java:65)
> at
> com.sun.enterprise.web.connector.grizzly.SocketChannelOutputBuffer.flushChannel(SocketChannelOutputBuffer.java:170)
> at
> com.sun.enterprise.web.connector.grizzly.async.AsynchronousOutputBuffer.flushChannel(AsynchronousOutputBuffer.java:81)
> at
> com.sun.enterprise.web.connector.grizzly.SocketChannelOutputBuffer.flushBuffer(SocketChannelOutputBuffer.java:203)
> at
> com.sun.enterprise.web.connector.grizzly.async.AsynchronousOutputBuffer.flushBuffer(AsynchronousOutputBuffer.java:113)
>
>
> --
> View this message in context: http://grizzly.1045725.n5.nabble.com/Broken-Pipe-and-client-is-busy-or-timeout-errors-tp4268012p4268012.html
> Sent from the Grizzly - Users mailing list archive at Nabble.com.