You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by "Geoff Cadien (JIRA)" <ji...@apache.org> on 2007/12/26 23:20:43 UTC

[jira] Created: (DIRMINA-503) NioProcessor.transferFile needs to catch IOException on Linux

NioProcessor.transferFile needs to catch IOException on Linux
-------------------------------------------------------------

                 Key: DIRMINA-503
                 URL: https://issues.apache.org/jira/browse/DIRMINA-503
             Project: MINA
          Issue Type: Bug
          Components: Core
         Environment: Linux 2.6.22 Sun JDK 1.6.0_03
            Reporter: Geoff Cadien
            Priority: Critical
             Fix For: 2.0.0-M1


Under Linux FileChannel.transferTo throws an IOException when the socket send buffer is full.  This causes the sending of a FileRegion to fail.  Here is the bug report http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5103988  Even though it is marked as fixed it continues to exist.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Reopened: (DIRMINA-503) NioProcessor.transferFile needs to catch IOException on Linux

Posted by "Mike Heath (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DIRMINA-503?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mike Heath reopened DIRMINA-503:
--------------------------------


> NioProcessor.transferFile needs to catch IOException on Linux
> -------------------------------------------------------------
>
>                 Key: DIRMINA-503
>                 URL: https://issues.apache.org/jira/browse/DIRMINA-503
>             Project: MINA
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.0.0-M1
>         Environment: Linux 2.6.22 Sun JDK 1.6.0_03
>            Reporter: Geoff Cadien
>            Assignee: Mike Heath
>            Priority: Critical
>             Fix For: 2.0.0-M1
>
>
> Under Linux FileChannel.transferTo throws an IOException when the socket send buffer is full.  This causes the sending of a FileRegion to fail.  Here is the bug report http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5103988  Even though it is marked as fixed it continues to exist.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DIRMINA-503) NioProcessor.transferFile needs to catch IOException on Linux

Posted by "Cameron Taggart (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DIRMINA-503?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12570800#action_12570800 ] 

Cameron Taggart commented on DIRMINA-503:
-----------------------------------------

When I try to build MINA (latest revision 629575), I get a test failure for NioFileRegionTest. 

D:\projects-svn\mina>mvn -version
Maven version: 2.0.8
Java version: 1.6.0
OS name: "windows xp" version: "5.1" arch: "x86" Family: "windows"

-------------------------------------------------------------------------------
Test set: org.apache.mina.transport.socket.nio.NioFileRegionTest
-------------------------------------------------------------------------------
Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.24 sec <<< FAILURE!
testSendLargeFile(org.apache.mina.transport.socket.nio.NioFileRegionTest)  Time elapsed: 0.22 sec  <<< FAILURE!
junit.framework.AssertionFailedError: Written messages should be 1 (we wrote one file) expected:<1> but was:<0>
	at junit.framework.Assert.fail(Assert.java:47)
	at junit.framework.Assert.failNotEquals(Assert.java:277)
	at junit.framework.Assert.assertEquals(Assert.java:64)
	at junit.framework.Assert.assertEquals(Assert.java:130)
	at org.apache.mina.transport.AbstractFileRegionTest.testSendLargeFile(AbstractFileRegionTest.java:93)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at junit.framework.TestCase.runTest(TestCase.java:168)
	at junit.framework.TestCase.runBare(TestCase.java:134)
	at junit.framework.TestResult$1.protect(TestResult.java:110)
	at junit.framework.TestResult.runProtected(TestResult.java:128)
	at junit.framework.TestResult.run(TestResult.java:113)
	at junit.framework.TestCase.run(TestCase.java:124)
	at junit.framework.TestSuite.runTest(TestSuite.java:232)
	at junit.framework.TestSuite.run(TestSuite.java:227)
	at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:81)
	at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
	at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
	at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
	at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:334)
	at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:980)



> NioProcessor.transferFile needs to catch IOException on Linux
> -------------------------------------------------------------
>
>                 Key: DIRMINA-503
>                 URL: https://issues.apache.org/jira/browse/DIRMINA-503
>             Project: MINA
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.0.0-M1
>         Environment: Linux 2.6.22 Sun JDK 1.6.0_03
>            Reporter: Geoff Cadien
>            Assignee: Mike Heath
>            Priority: Critical
>             Fix For: 2.0.0-M1
>
>
> Under Linux FileChannel.transferTo throws an IOException when the socket send buffer is full.  This causes the sending of a FileRegion to fail.  Here is the bug report http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5103988  Even though it is marked as fixed it continues to exist.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Closed: (DIRMINA-503) NioProcessor.transferFile needs to catch IOException on Linux

Posted by "Emmanuel Lecharny (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DIRMINA-503?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Emmanuel Lecharny closed DIRMINA-503.
-------------------------------------


> NioProcessor.transferFile needs to catch IOException on Linux
> -------------------------------------------------------------
>
>                 Key: DIRMINA-503
>                 URL: https://issues.apache.org/jira/browse/DIRMINA-503
>             Project: MINA
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.0.0-M1
>         Environment: Linux 2.6.22 Sun JDK 1.6.0_03
>            Reporter: Geoff Cadien
>            Assignee: Mike Heath
>            Priority: Critical
>             Fix For: 2.0.0-M1
>
>
> Under Linux FileChannel.transferTo throws an IOException when the socket send buffer is full.  This causes the sending of a FileRegion to fail.  Here is the bug report http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5103988  Even though it is marked as fixed it continues to exist.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DIRMINA-503) NioProcessor.transferFile needs to catch IOException on Linux

Posted by "Geoff Cadien (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DIRMINA-503?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12556135#action_12556135 ] 

Geoff Cadien commented on DIRMINA-503:
--------------------------------------

Mike I am still seeing the IOException.  But after a little investigation it seems like it is now only throw when I write 2 or more FileRegions to the session.  The IOException isn't thrown when I write a single FileRegion.

> NioProcessor.transferFile needs to catch IOException on Linux
> -------------------------------------------------------------
>
>                 Key: DIRMINA-503
>                 URL: https://issues.apache.org/jira/browse/DIRMINA-503
>             Project: MINA
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.0.0-M1
>         Environment: Linux 2.6.22 Sun JDK 1.6.0_03
>            Reporter: Geoff Cadien
>            Assignee: Mike Heath
>            Priority: Critical
>             Fix For: 2.0.0-M1
>
>
> Under Linux FileChannel.transferTo throws an IOException when the socket send buffer is full.  This causes the sending of a FileRegion to fail.  Here is the bug report http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5103988  Even though it is marked as fixed it continues to exist.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (DIRMINA-503) NioProcessor.transferFile needs to catch IOException on Linux

Posted by "Mike Heath (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DIRMINA-503?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mike Heath resolved DIRMINA-503.
--------------------------------

    Resolution: Fixed

This has been fixed although I'm unsure if it will affect the APR transport.

> NioProcessor.transferFile needs to catch IOException on Linux
> -------------------------------------------------------------
>
>                 Key: DIRMINA-503
>                 URL: https://issues.apache.org/jira/browse/DIRMINA-503
>             Project: MINA
>          Issue Type: Bug
>          Components: Core
>         Environment: Linux 2.6.22 Sun JDK 1.6.0_03
>            Reporter: Geoff Cadien
>            Assignee: Mike Heath
>            Priority: Critical
>             Fix For: 2.0.0-M1
>
>
> Under Linux FileChannel.transferTo throws an IOException when the socket send buffer is full.  This causes the sending of a FileRegion to fail.  Here is the bug report http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5103988  Even though it is marked as fixed it continues to exist.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (DIRMINA-503) NioProcessor.transferFile needs to catch IOException on Linux

Posted by "Mike Heath (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DIRMINA-503?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mike Heath reassigned DIRMINA-503:
----------------------------------

    Assignee: Mike Heath

> NioProcessor.transferFile needs to catch IOException on Linux
> -------------------------------------------------------------
>
>                 Key: DIRMINA-503
>                 URL: https://issues.apache.org/jira/browse/DIRMINA-503
>             Project: MINA
>          Issue Type: Bug
>          Components: Core
>         Environment: Linux 2.6.22 Sun JDK 1.6.0_03
>            Reporter: Geoff Cadien
>            Assignee: Mike Heath
>            Priority: Critical
>             Fix For: 2.0.0-M1
>
>
> Under Linux FileChannel.transferTo throws an IOException when the socket send buffer is full.  This causes the sending of a FileRegion to fail.  Here is the bug report http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5103988  Even though it is marked as fixed it continues to exist.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (DIRMINA-503) NioProcessor.transferFile needs to catch IOException on Linux

Posted by "Mike Heath (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DIRMINA-503?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mike Heath resolved DIRMINA-503.
--------------------------------

    Resolution: Fixed

I've added an explicit IOException check for the cases that my earlier fix will miss.

> NioProcessor.transferFile needs to catch IOException on Linux
> -------------------------------------------------------------
>
>                 Key: DIRMINA-503
>                 URL: https://issues.apache.org/jira/browse/DIRMINA-503
>             Project: MINA
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.0.0-M1
>         Environment: Linux 2.6.22 Sun JDK 1.6.0_03
>            Reporter: Geoff Cadien
>            Assignee: Mike Heath
>            Priority: Critical
>             Fix For: 2.0.0-M1
>
>
> Under Linux FileChannel.transferTo throws an IOException when the socket send buffer is full.  This causes the sending of a FileRegion to fail.  Here is the bug report http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5103988  Even though it is marked as fixed it continues to exist.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DIRMINA-503) NioProcessor.transferFile needs to catch IOException on Linux

Posted by "Mike Heath (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DIRMINA-503?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12556102#action_12556102 ] 

Mike Heath commented on DIRMINA-503:
------------------------------------

Are you still seeing the IOException?  I wrote a unit test for sending a 1MB file using FileRegion that passes with my fix when run on Linux.

To explain the logic behind my fix, the IOException gets thrown when the kernel write buffer is full and FileChannel.transferTo is invoked.  With the change I made, FileChannel.transferTo gets invoked which will either fill the kernel write buffer or write the remaining data from the file.  If the entire FileRegion has been sent, the file transfer completes.  Otherwise, MINA will wait for a write completion event to resume sending the file.  This write completion event is triggered when data in the kernel write buffer has been successfully sent over the wire thereby making room in the write buffer for more data.  When the write completion event is processed, we resume sending the file by again calling FileChannel.transferTo.  We know that they kernel write buffer is not full in this case so the IOException will not be thrown.

If I'm missing something, please let me know.  MINA should probably catch the exception just in case.

> NioProcessor.transferFile needs to catch IOException on Linux
> -------------------------------------------------------------
>
>                 Key: DIRMINA-503
>                 URL: https://issues.apache.org/jira/browse/DIRMINA-503
>             Project: MINA
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.0.0-M1
>         Environment: Linux 2.6.22 Sun JDK 1.6.0_03
>            Reporter: Geoff Cadien
>            Assignee: Mike Heath
>            Priority: Critical
>             Fix For: 2.0.0-M1
>
>
> Under Linux FileChannel.transferTo throws an IOException when the socket send buffer is full.  This causes the sending of a FileRegion to fail.  Here is the bug report http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5103988  Even though it is marked as fixed it continues to exist.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (DIRMINA-503) NioProcessor.transferFile needs to catch IOException on Linux

Posted by "Mike Heath (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DIRMINA-503?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mike Heath updated DIRMINA-503:
-------------------------------

    Affects Version/s: 2.0.0-M1

> NioProcessor.transferFile needs to catch IOException on Linux
> -------------------------------------------------------------
>
>                 Key: DIRMINA-503
>                 URL: https://issues.apache.org/jira/browse/DIRMINA-503
>             Project: MINA
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.0.0-M1
>         Environment: Linux 2.6.22 Sun JDK 1.6.0_03
>            Reporter: Geoff Cadien
>            Assignee: Mike Heath
>            Priority: Critical
>             Fix For: 2.0.0-M1
>
>
> Under Linux FileChannel.transferTo throws an IOException when the socket send buffer is full.  This causes the sending of a FileRegion to fail.  Here is the bug report http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5103988  Even though it is marked as fixed it continues to exist.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DIRMINA-503) NioProcessor.transferFile needs to catch IOException on Linux

Posted by "Trustin Lee (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DIRMINA-503?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12554644 ] 

Trustin Lee commented on DIRMINA-503:
-------------------------------------

The APR transport doesn't support file transfer yet.  It should be easy to implement though.  :)

> NioProcessor.transferFile needs to catch IOException on Linux
> -------------------------------------------------------------
>
>                 Key: DIRMINA-503
>                 URL: https://issues.apache.org/jira/browse/DIRMINA-503
>             Project: MINA
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.0.0-M1
>         Environment: Linux 2.6.22 Sun JDK 1.6.0_03
>            Reporter: Geoff Cadien
>            Assignee: Mike Heath
>            Priority: Critical
>             Fix For: 2.0.0-M1
>
>
> Under Linux FileChannel.transferTo throws an IOException when the socket send buffer is full.  This causes the sending of a FileRegion to fail.  Here is the bug report http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5103988  Even though it is marked as fixed it continues to exist.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DIRMINA-503) NioProcessor.transferFile needs to catch IOException on Linux

Posted by "Geoff Cadien (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DIRMINA-503?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12555986#action_12555986 ] 

Geoff Cadien commented on DIRMINA-503:
--------------------------------------

I'm not sure this is actually fixed.  NioProcessor.transferFile will still throw an IOException.  The IOException will be caught in AbstractPollingIoProcessor.flushNow and exceptionCaught will be fired.  I don't think user code should ever see this exception.  It needs to be handled within Mina and not propagated.

> NioProcessor.transferFile needs to catch IOException on Linux
> -------------------------------------------------------------
>
>                 Key: DIRMINA-503
>                 URL: https://issues.apache.org/jira/browse/DIRMINA-503
>             Project: MINA
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.0.0-M1
>         Environment: Linux 2.6.22 Sun JDK 1.6.0_03
>            Reporter: Geoff Cadien
>            Assignee: Mike Heath
>            Priority: Critical
>             Fix For: 2.0.0-M1
>
>
> Under Linux FileChannel.transferTo throws an IOException when the socket send buffer is full.  This causes the sending of a FileRegion to fail.  Here is the bug report http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5103988  Even though it is marked as fixed it continues to exist.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DIRMINA-503) NioProcessor.transferFile needs to catch IOException on Linux

Posted by "Mike Heath (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DIRMINA-503?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12556140#action_12556140 ] 

Mike Heath commented on DIRMINA-503:
------------------------------------

That is certainly a case that could cause a problem.  I'll put in a catch for IOException as well as see if I can't refactor the existing code to better deal with this scenario.

> NioProcessor.transferFile needs to catch IOException on Linux
> -------------------------------------------------------------
>
>                 Key: DIRMINA-503
>                 URL: https://issues.apache.org/jira/browse/DIRMINA-503
>             Project: MINA
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.0.0-M1
>         Environment: Linux 2.6.22 Sun JDK 1.6.0_03
>            Reporter: Geoff Cadien
>            Assignee: Mike Heath
>            Priority: Critical
>             Fix For: 2.0.0-M1
>
>
> Under Linux FileChannel.transferTo throws an IOException when the socket send buffer is full.  This causes the sending of a FileRegion to fail.  Here is the bug report http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5103988  Even though it is marked as fixed it continues to exist.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DIRMINA-503) NioProcessor.transferFile needs to catch IOException on Linux

Posted by "Mike Heath (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DIRMINA-503?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12571218#action_12571218 ] 

Mike Heath commented on DIRMINA-503:
------------------------------------

This test should be fixed now.  Please let me know if it continues to fail.

> NioProcessor.transferFile needs to catch IOException on Linux
> -------------------------------------------------------------
>
>                 Key: DIRMINA-503
>                 URL: https://issues.apache.org/jira/browse/DIRMINA-503
>             Project: MINA
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.0.0-M1
>         Environment: Linux 2.6.22 Sun JDK 1.6.0_03
>            Reporter: Geoff Cadien
>            Assignee: Mike Heath
>            Priority: Critical
>             Fix For: 2.0.0-M1
>
>
> Under Linux FileChannel.transferTo throws an IOException when the socket send buffer is full.  This causes the sending of a FileRegion to fail.  Here is the bug report http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5103988  Even though it is marked as fixed it continues to exist.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.