Fix the way javatest Agent opens sockets

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P3
    • jt6.0
    • Affects Version/s: None
    • Component/s: tools
    • None
    • b02
    • solaris

      From Jonathan Gibbons:

      The line that is a problem is this one:
      http://hg.openjdk.java.net/code-tools/jtharness/file/6c2635575044/src/com/sun/javatest/agent/SocketConnection.java#l226


                 ServerSocket serverSocket = new ServerSocket(port, backlog);


      The problem is that on Solaris, when port==0 and when using high concurrency, this code is subject to race in the underlying code, such that
      another thread can "steal" the port that gets allocated.

      The original background details are here:
      https://java.se.oracle.com/infrabugs/browse/INFRA-12103
      The jtreg aspects of this are here:
      https://bugs.openjdk.java.net/browse/CODETOOLS-7902047
      And the jtreg fix is here.
      http://hg.openjdk.java.net/code-tools/jtreg/rev/986882b3be7e

      The fix for JT Harness should be very similar, although you might want to may it conditional on port==0.

            Assignee:
            Dmitry Bessonov
            Reporter:
            Alexey Fedorchenko (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: