Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6429790

(se) Selector.select() does not block and returns 0, forever

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 5.0
    • core-libs
    • x86
    • windows_xp

      FULL PRODUCT VERSION :
      java -version
      java version "1.5.0_06"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_06-b05)
      Java HotSpot(TM) Client VM (build 1.5.0_06-b05, mixed mode)


      ADDITIONAL OS VERSION INFORMATION :
      Windows XP SP2 (Pentium 4, hyperthreading)

      A DESCRIPTION OF THE PROBLEM :
      The documentation for Selector describes precisely when a call to select() will return, i.e. "at least one channel is selected, this selector's wakeup method is invoked, or the current thread is interrupted, whichever comes first."
      I found two scenario where select() returns 0 without blocking, forever:
      - When a channel registers with the Selector with an interest set of 0.
      - When a socket channel that had not completed the connection process (invoking finishConnect until returning true) is registered with READ/WRITE interest set without CONNECT.

      This behaviour is not consistent with the doc, maybe it can be considered a bug, or maybe the doc should change.


      REPRODUCIBILITY :
      This bug can be reproduced always.

            Unassigned Unassigned
            ndcosta Nelson Dcosta (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: