You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by "Waleed Basheer (JIRA)" <ji...@apache.org> on 2012/07/25 16:24:34 UTC

[jira] [Commented] (DIRMINA-894) java.io.IOException: Broken Pipe infinite loop

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

Waleed Basheer commented on DIRMINA-894:
----------------------------------------

Not sure if what I did was sufficient to apply the fix but I used the 2.0.4 release source and replaced the AbstractIoSession.java file with revision 1359234 and am still getting the infinite loop of exceptions.  Was replacing that one file enough to prevent this bug or is there more actions required since 2.0.5 isn't released yet?

Here is the stack trace of the error:

java.io.IOException: Broken pipe
        at sun.nio.ch.FileDispatcher.write0(Native Method) [na:1.6.0_24]
        at sun.nio.ch.SocketDispatcher.write(SocketDispatcher.java:47) [na:1.6.0_24]
        at sun.nio.ch.IOUtil.writeFromNativeBuffer(IOUtil.java:122) [na:1.6.0_24]
        at sun.nio.ch.IOUtil.write(IOUtil.java:93) [na:1.6.0_24]
        at sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:352) [na:1.6.0_24]
        at org.apache.mina.transport.socket.nio.NioProcessor.write(NioProcessor.java:287) [mina-core-2.0.4.jar:na]
        at org.apache.mina.transport.socket.nio.NioProcessor.write(NioProcessor.java:44) [mina-core-2.0.4.jar:na]
        at org.apache.mina.core.polling.AbstractPollingIoProcessor.writeBuffer(AbstractPollingIoProcessor.java:950) [mina-core-2.0.4.jar:na]
        at org.apache.mina.core.polling.AbstractPollingIoProcessor.flushNow(AbstractPollingIoProcessor.java:874) [mina-core-2.0.4.jar:na]
        at org.apache.mina.core.polling.AbstractPollingIoProcessor.flush(AbstractPollingIoProcessor.java:799) [mina-core-2.0.4.jar:na]
        at org.apache.mina.core.polling.AbstractPollingIoProcessor.access$700(AbstractPollingIoProcessor.java:68) [mina-core-2.0.4.jar:na]
        at org.apache.mina.core.polling.AbstractPollingIoProcessor$Processor.run(AbstractPollingIoProcessor.java:1146) [mina-core-2.0.4.jar:na]
        at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:64) [mina-core-2.0.4.jar:na]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [na:1.6.0_24]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [na:1.6.0_24]
        at java.lang.Thread.run(Thread.java:679) [na:1.6.0_24]

                
> java.io.IOException: Broken Pipe infinite loop
> ----------------------------------------------
>
>                 Key: DIRMINA-894
>                 URL: https://issues.apache.org/jira/browse/DIRMINA-894
>             Project: MINA
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.0.4
>            Reporter: Yannick Lecaillez
>            Priority: Critical
>             Fix For: 2.0.5
>
>
> An infinite java.io.IOException can occurs in when a session.close(false) is called in a IoFilter.exceptionCaught().
> Indeed:
> AbstractPollingIoProcessor.flush(time) (line 777): 
>   This method flush all sessions contained in flushingSession. It does that until there is no more flushingSession
> AbstractPollingIoProcessor.flushNow(session,time) (line 832):
>   Process write request. 
>   If an exception occurs during the write, IoFilter.exceptionCaught() is called ;
> IoFilter.exceptionCaught() (user code): 
>   call session.close(false);
> AbstractIoSession.close(false): (line 286) call closeOnFlush()
> AbstractIoSession.closeOnFlush() : 
>   add a CLOSE_REQUEST into the WriteQueue and flush() the session.
>   this session is then appended to the flushingSessions. 
>   
> Since the exception handling code in flushNow() doesn't reset the session.getCurrentWriteRequest(), the writeRequestQueue is never polled and the processor will try to process the same write request infinitly.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira