Uploaded image for project: 'Harmony'
  1. Harmony
  2. HARMONY-6638

[classlib][nio]Some Selector behavior fixed.

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • 5.0M14
    • None
    • Classlib
    • None
    • Patch Available

    Description

      There are some problems with harmony Selector:
      1. When a serversocket channel does not bind anything, selector should return acceptable. In this situation, poll return POLLHUP. I add this flag to the native code.
      2. The same as 1, when a socketChannel does not connect any anything, selector should return connectable. In this situation, poll return POLLHUP, I also add this flag to the native code.
      3. As the spec said, selector should also return if an error occurred. I'm not testing the error condition, but I add POLLERR to the native code.
      4. If user change the interested operations of a selector, this selector should treated as a new one (but with the same SelectionKey). On the other hand, if the selector was return once and no interested operation changed, it should not be selected next time. I have add a flag stateChange in the SelectionKeyImpl to save this state.

      Attachments

        1. HARMONY-6638.diff
          13 kB
          Charles Lee

        Activity

          littlee Charles Lee added a comment -

          Some test cases is not suitable for windows, I have add a new test case in the unix. Others are add in the common.
          Is anyone interested in this?

          littlee Charles Lee added a comment - Some test cases is not suitable for windows, I have add a new test case in the unix. Others are add in the common. Is anyone interested in this?
          littlee Charles Lee added a comment -

          Applied at r1002476.

          littlee Charles Lee added a comment - Applied at r1002476.
          hudson Hudson added a comment -

          Integrated in Harmony-select-1.5-head-linux-x86_64 #126 (See https://hudson.apache.org/hudson/job/Harmony-select-1.5-head-linux-x86_64/126/)
          Applying patch from HARMONY-6638:
          1. In Linux, ServerSocketChannel should be acceptable if its server socket bind any address.
          2. In Linux, SocketChannel should be connectable if it does not connect anything.
          3. The Selector should also return if an error occurred.
          4. If user change the interested operations of a selector, this
          selector should treated as a new one (but with the same
          SelectionKey). On the other hand, if the selector was return once and
          no interested operation changed, it should not be selected next time.

          hudson Hudson added a comment - Integrated in Harmony-select-1.5-head-linux-x86_64 #126 (See https://hudson.apache.org/hudson/job/Harmony-select-1.5-head-linux-x86_64/126/ ) Applying patch from HARMONY-6638 : 1. In Linux, ServerSocketChannel should be acceptable if its server socket bind any address. 2. In Linux, SocketChannel should be connectable if it does not connect anything. 3. The Selector should also return if an error occurred. 4. If user change the interested operations of a selector, this selector should treated as a new one (but with the same SelectionKey). On the other hand, if the selector was return once and no interested operation changed, it should not be selected next time.
          hudson Hudson added a comment -

          Integrated in Harmony-1.5-head-linux-x86_64 #973 (See https://hudson.apache.org/hudson/job/Harmony-1.5-head-linux-x86_64/973/)
          Applying patch from HARMONY-6638:
          1. In Linux, ServerSocketChannel should be acceptable if its server socket bind any address.
          2. In Linux, SocketChannel should be connectable if it does not connect anything.
          3. The Selector should also return if an error occurred.
          4. If user change the interested operations of a selector, this
          selector should treated as a new one (but with the same
          SelectionKey). On the other hand, if the selector was return once and
          no interested operation changed, it should not be selected next time.

          hudson Hudson added a comment - Integrated in Harmony-1.5-head-linux-x86_64 #973 (See https://hudson.apache.org/hudson/job/Harmony-1.5-head-linux-x86_64/973/ ) Applying patch from HARMONY-6638 : 1. In Linux, ServerSocketChannel should be acceptable if its server socket bind any address. 2. In Linux, SocketChannel should be connectable if it does not connect anything. 3. The Selector should also return if an error occurred. 4. If user change the interested operations of a selector, this selector should treated as a new one (but with the same SelectionKey). On the other hand, if the selector was return once and no interested operation changed, it should not be selected next time.
          hudson Hudson added a comment -

          Integrated in Harmony-select-1.5-head-linux-x86_64 #144 (See https://hudson.apache.org/hudson/job/Harmony-select-1.5-head-linux-x86_64/144/)
          Back-out part of change from revision 1002476 (fix for HARMONY-6638) that checks if the key is connected before OP_CONNECT is added to the list of selected keys. Adding a test that registers an OP_CONNECT key on a socket channel, connects and then checks there's a key in the selectedKeys() list passes on the RI (also removing the check doesn't cause the regression test that was added for 1002376 to fail).

          hudson Hudson added a comment - Integrated in Harmony-select-1.5-head-linux-x86_64 #144 (See https://hudson.apache.org/hudson/job/Harmony-select-1.5-head-linux-x86_64/144/ ) Back-out part of change from revision 1002476 (fix for HARMONY-6638 ) that checks if the key is connected before OP_CONNECT is added to the list of selected keys. Adding a test that registers an OP_CONNECT key on a socket channel, connects and then checks there's a key in the selectedKeys() list passes on the RI (also removing the check doesn't cause the regression test that was added for 1002376 to fail).
          hudson Hudson added a comment -

          Integrated in Harmony-1.5-head-linux-x86_64 #992 (See https://hudson.apache.org/hudson/job/Harmony-1.5-head-linux-x86_64/992/)
          Back-out part of change from revision 1002476 (fix for HARMONY-6638) that checks if the key is connected before OP_CONNECT is added to the list of selected keys. Adding a test that registers an OP_CONNECT key on a socket channel, connects and then checks there's a key in the selectedKeys() list passes on the RI (also removing the check doesn't cause the regression test that was added for 1002376 to fail).

          hudson Hudson added a comment - Integrated in Harmony-1.5-head-linux-x86_64 #992 (See https://hudson.apache.org/hudson/job/Harmony-1.5-head-linux-x86_64/992/ ) Back-out part of change from revision 1002476 (fix for HARMONY-6638 ) that checks if the key is connected before OP_CONNECT is added to the list of selected keys. Adding a test that registers an OP_CONNECT key on a socket channel, connects and then checks there's a key in the selectedKeys() list passes on the RI (also removing the check doesn't cause the regression test that was added for 1002376 to fail).

          People

            littlee Charles Lee
            littlee Charles Lee
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: