Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-47965

IOHub may hang infinitely on Windows if Selector does not get data

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Critical
    • remoting
    • None
    • Win 10, amd64, Oracle JDK 8u131
      Remoting 3.14

    Description

      I discovered it during the cleanup of JENKINS-38696.

      Windows implementation of NIO Channel Selector does not request "Select now" in https://github.com/jenkinsci/remoting/blob/6165d6fb6a71a7f4fce52ce5fc4cac479052ce04/src/main/java/org/jenkinsci/remoting/protocol/IOHub.java#L436 and hence calls selector#select()... and this method has no timeout.

      When the code gets into this branch, Selector will be waiting infinitely without calling selector#isOpen(). Such implementation relies on the Selector implementation, which shout interrupt the select() wait if the selector is being closed. But apparently it does not no my machine (Win 10, amd64, Oracle JDK 8u131)

      I propose to just add wait timeout and make the IOHub implementation to loop in the logic.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              oleg_nenashev Oleg Nenashev
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: