MINA
  1. MINA
  2. DIRMINA-717

DefaultIoFuture.awaitUninterrruptibly() doesn't wait!

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.0-M6
    • Fix Version/s: 2.0.0-RC1
    • Component/s: Core
    • Labels:
      None

      Description

      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().

        Activity

        Stephen Crane created issue -
        Emmanuel Lecharny made changes -
        Field Original Value New Value
        Fix Version/s 2.0.0-M7 [ 12313995 ]
        Emmanuel Lecharny made changes -
        Assignee Emmanuel Lecharny [ elecharny ]
        Show
        Emmanuel Lecharny added a comment - Fixed in http://svn.apache.org/viewvc?rev=781711&view=rev
        Emmanuel Lecharny made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Julien Vermillard made changes -
        Fix Version/s 2.0.0-RC1 [ 12313865 ]
        Fix Version/s 2.0.0-M7 [ 12313995 ]
        Emmanuel Lecharny made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Resolved Resolved
        3h 15m 1 Emmanuel Lecharny 04/Jun/09 14:40
        Resolved Resolved Closed Closed
        232d 3h 56m 1 Emmanuel Lecharny 22/Jan/10 17:37

          People

          • Assignee:
            Emmanuel Lecharny
            Reporter:
            Stephen Crane
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development