You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by "Stephen Crane (JIRA)" <ji...@apache.org> on 2009/06/04 12:27:07 UTC

[jira] Created: (DIRMINA-717) DefaultIoFuture.awaitUninterrruptibly() doesn't wait!

DefaultIoFuture.awaitUninterrruptibly() doesn't wait!
-----------------------------------------------------

                 Key: DIRMINA-717
                 URL: https://issues.apache.org/jira/browse/DIRMINA-717
             Project: MINA
          Issue Type: Bug
          Components: Core
    Affects Versions: 2.0.0-M6
            Reporter: Stephen Crane


DefaultIoFuture.awaitUninterrruptibly() calls await0(Log.MAX_VALUE,
false) which does:

        long endTime = System.currentTimeMillis() + timeoutMillis;

i.e., 
        long endTime = System.currentTimeMillis() + Long.MAX_VALUE;

This comes out <0 which leads to:

            if (ready) {
                return ready;
            } else if (timeoutMillis <= 0) {
                return ready;
            }

Doesn't really matter what is returned here because the return value is
ignored by the caller:

        try {
            await0(Long.MAX_VALUE, false);
        } catch ( InterruptedException ie) {
            // Do nothing : this catch is just mandatory by contract
        }

The right solution IMHO would be to use a timeout of -1 to wait forever
and 0 for a poll. However you might prefer:

        long endTime = timeoutMillis;
        if (endTime != Long.MAX_VALUE)
                endTime += System.currentTimeMillis();

BTW I think this is also related to the Shutdown Thread. It looks like this pattern is used around the disposalFuture. See AbstractIoService.dispose().

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


[jira] Closed: (DIRMINA-717) DefaultIoFuture.awaitUninterrruptibly() doesn't wait!

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

Emmanuel Lecharny closed DIRMINA-717.
-------------------------------------


> DefaultIoFuture.awaitUninterrruptibly() doesn't wait!
> -----------------------------------------------------
>
>                 Key: DIRMINA-717
>                 URL: https://issues.apache.org/jira/browse/DIRMINA-717
>             Project: MINA
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.0.0-M6
>            Reporter: Stephen Crane
>            Assignee: Emmanuel Lecharny
>             Fix For: 2.0.0-RC1
>
>
> DefaultIoFuture.awaitUninterrruptibly() calls await0(Log.MAX_VALUE,
> false) which does:
>         long endTime = System.currentTimeMillis() + timeoutMillis;
> i.e., 
>         long endTime = System.currentTimeMillis() + Long.MAX_VALUE;
> This comes out <0 which leads to:
>             if (ready) {
>                 return ready;
>             } else if (timeoutMillis <= 0) {
>                 return ready;
>             }
> Doesn't really matter what is returned here because the return value is
> ignored by the caller:
>         try {
>             await0(Long.MAX_VALUE, false);
>         } catch ( InterruptedException ie) {
>             // Do nothing : this catch is just mandatory by contract
>         }
> The right solution IMHO would be to use a timeout of -1 to wait forever
> and 0 for a poll. However you might prefer:
>         long endTime = timeoutMillis;
>         if (endTime != Long.MAX_VALUE)
>                 endTime += System.currentTimeMillis();
> BTW I think this is also related to the Shutdown Thread. It looks like this pattern is used around the disposalFuture. See AbstractIoService.dispose().

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


[jira] Updated: (DIRMINA-717) DefaultIoFuture.awaitUninterrruptibly() doesn't wait!

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

Emmanuel Lecharny updated DIRMINA-717:
--------------------------------------

    Fix Version/s: 2.0.0-M7

> DefaultIoFuture.awaitUninterrruptibly() doesn't wait!
> -----------------------------------------------------
>
>                 Key: DIRMINA-717
>                 URL: https://issues.apache.org/jira/browse/DIRMINA-717
>             Project: MINA
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.0.0-M6
>            Reporter: Stephen Crane
>             Fix For: 2.0.0-M7
>
>
> DefaultIoFuture.awaitUninterrruptibly() calls await0(Log.MAX_VALUE,
> false) which does:
>         long endTime = System.currentTimeMillis() + timeoutMillis;
> i.e., 
>         long endTime = System.currentTimeMillis() + Long.MAX_VALUE;
> This comes out <0 which leads to:
>             if (ready) {
>                 return ready;
>             } else if (timeoutMillis <= 0) {
>                 return ready;
>             }
> Doesn't really matter what is returned here because the return value is
> ignored by the caller:
>         try {
>             await0(Long.MAX_VALUE, false);
>         } catch ( InterruptedException ie) {
>             // Do nothing : this catch is just mandatory by contract
>         }
> The right solution IMHO would be to use a timeout of -1 to wait forever
> and 0 for a poll. However you might prefer:
>         long endTime = timeoutMillis;
>         if (endTime != Long.MAX_VALUE)
>                 endTime += System.currentTimeMillis();
> BTW I think this is also related to the Shutdown Thread. It looks like this pattern is used around the disposalFuture. See AbstractIoService.dispose().

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


[jira] Assigned: (DIRMINA-717) DefaultIoFuture.awaitUninterrruptibly() doesn't wait!

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

Emmanuel Lecharny reassigned DIRMINA-717:
-----------------------------------------

    Assignee: Emmanuel Lecharny

> DefaultIoFuture.awaitUninterrruptibly() doesn't wait!
> -----------------------------------------------------
>
>                 Key: DIRMINA-717
>                 URL: https://issues.apache.org/jira/browse/DIRMINA-717
>             Project: MINA
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.0.0-M6
>            Reporter: Stephen Crane
>            Assignee: Emmanuel Lecharny
>             Fix For: 2.0.0-M7
>
>
> DefaultIoFuture.awaitUninterrruptibly() calls await0(Log.MAX_VALUE,
> false) which does:
>         long endTime = System.currentTimeMillis() + timeoutMillis;
> i.e., 
>         long endTime = System.currentTimeMillis() + Long.MAX_VALUE;
> This comes out <0 which leads to:
>             if (ready) {
>                 return ready;
>             } else if (timeoutMillis <= 0) {
>                 return ready;
>             }
> Doesn't really matter what is returned here because the return value is
> ignored by the caller:
>         try {
>             await0(Long.MAX_VALUE, false);
>         } catch ( InterruptedException ie) {
>             // Do nothing : this catch is just mandatory by contract
>         }
> The right solution IMHO would be to use a timeout of -1 to wait forever
> and 0 for a poll. However you might prefer:
>         long endTime = timeoutMillis;
>         if (endTime != Long.MAX_VALUE)
>                 endTime += System.currentTimeMillis();
> BTW I think this is also related to the Shutdown Thread. It looks like this pattern is used around the disposalFuture. See AbstractIoService.dispose().

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


[jira] Resolved: (DIRMINA-717) DefaultIoFuture.awaitUninterrruptibly() doesn't wait!

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

Emmanuel Lecharny resolved DIRMINA-717.
---------------------------------------

    Resolution: Fixed

Fixed in http://svn.apache.org/viewvc?rev=781711&view=rev

> DefaultIoFuture.awaitUninterrruptibly() doesn't wait!
> -----------------------------------------------------
>
>                 Key: DIRMINA-717
>                 URL: https://issues.apache.org/jira/browse/DIRMINA-717
>             Project: MINA
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.0.0-M6
>            Reporter: Stephen Crane
>            Assignee: Emmanuel Lecharny
>             Fix For: 2.0.0-M7
>
>
> DefaultIoFuture.awaitUninterrruptibly() calls await0(Log.MAX_VALUE,
> false) which does:
>         long endTime = System.currentTimeMillis() + timeoutMillis;
> i.e., 
>         long endTime = System.currentTimeMillis() + Long.MAX_VALUE;
> This comes out <0 which leads to:
>             if (ready) {
>                 return ready;
>             } else if (timeoutMillis <= 0) {
>                 return ready;
>             }
> Doesn't really matter what is returned here because the return value is
> ignored by the caller:
>         try {
>             await0(Long.MAX_VALUE, false);
>         } catch ( InterruptedException ie) {
>             // Do nothing : this catch is just mandatory by contract
>         }
> The right solution IMHO would be to use a timeout of -1 to wait forever
> and 0 for a poll. However you might prefer:
>         long endTime = timeoutMillis;
>         if (endTime != Long.MAX_VALUE)
>                 endTime += System.currentTimeMillis();
> BTW I think this is also related to the Shutdown Thread. It looks like this pattern is used around the disposalFuture. See AbstractIoService.dispose().

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