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

TEST_BUG: java/rmi/reliability/benchmark fails intermittently because of use of fixed port

    Details

    • Subcomponent:
    • Resolved In Build:
      b120
    • CPU:
      generic
    • OS:
      generic

      Backports

        Description

        TESTFAIL:java/rmi/reliability/benchmark/runRmiBench.sh

        The regression test java/rmi/reliability/benchmark/runRmiBench.sh can fail because it uses a fixed port. If this port is already in use by something else on the system, the test will fail.

        Basically the runRmiBench.sh script uses a hardcoded port of 2007, and it passes this port value to both the client and server JVMs. If this port is already in use, the server will fail to start, and the client will fail because it cannot connect.

        This occurred recently in a JPRT integration run. The log is below.

        Either a port should be reserved in java/rmi/testlibrary, or a random unused port should be chosen and then passed to both the client and the server.

        --------------------------------------------------
        TEST: java/rmi/reliability/benchmark/runRmiBench.sh
        JDK under test: (C:\jprt\T\P1\120929~1.JCG\TESTPR~1\WINDOW~1.2-P)
        java version "1.8.0-internal"
        Java(TM) SE Runtime Environment (build 1.8.0-internal-201208081209.jcg-int.tl-pit-2d-awt-b00)
        Java HotSpot(TM) 64-Bit Server VM (build 24.0-b18, mixed mode)

        [... many build lines omitted ...]

        ACTION: shell -- Failed. Execution failed: exit code 1
        REASON: User specified action: run shell/timeout=1800 runRmiBench.sh
        TIME: 11.594 seconds
        messages:
        command: shell runRmiBench.sh []
        reason: User specified action: run shell/timeout=1800 runRmiBench.sh
        elapsed time (seconds): 11.594
        STDOUT:
        Starting RMI benchmark server
        Starting RMI benchmark client
        STDERR:
        Error: failed to initialize server: java.rmi.server.ExportException: Port already in use: 2007; nested exception is:
        java.net.BindException: Address already in use: JVM_Bind
        Error: failed to connect to server: java.rmi.ConnectException: Connection refused to host: localhost; nested exception is:
        java.net.ConnectException: Connection refused: connect

        TEST RESULT: Failed. Execution failed: exit code 1
        --------------------------------------------------

          Issue Links

            Activity

            Hide
            smarks Stuart Marks added a comment -
            When reactivating this test, check that TESTVMOPTS is handled correctly.

            Also, this test, along with runSerialBench.sh, are pretty questionable to run in a regression test suite. They are tuned to run smaller loads when run by jtreg as compared to the ksh scripts used for invoking them as actual benchmarks. It might be worthwhile tuning them to run more quickly though. On my system runRmiBench.sh runs in 106 sec and runSerialBench.sh runs in 9 sec. Would be nice to get runRmibench.sh down to 10 sec or so, certainly less than 30 sec.
            Show
            smarks Stuart Marks added a comment - When reactivating this test, check that TESTVMOPTS is handled correctly. Also, this test, along with runSerialBench.sh, are pretty questionable to run in a regression test suite. They are tuned to run smaller loads when run by jtreg as compared to the ksh scripts used for invoking them as actual benchmarks. It might be worthwhile tuning them to run more quickly though. On my system runRmiBench.sh runs in 106 sec and runSerialBench.sh runs in 9 sec. Would be nice to get runRmibench.sh down to 10 sec or so, certainly less than 30 sec.
            Hide
            skonchad Sandeep Konchady added a comment -
            Assigning to Tristan
            Show
            skonchad Sandeep Konchady added a comment - Assigning to Tristan
            Hide
            tyan Tristan Yan (Inactive) added a comment - - edited
            Failure History:
                 This test was added to the ProblemList, hence no failure history in Aurora

            # 7190106
            java/rmi/reliability/benchmark/runRmiBench.sh generic-all
            Show
            tyan Tristan Yan (Inactive) added a comment - - edited Failure History:      This test was added to the ProblemList, hence no failure history in Aurora # 7190106 java/rmi/reliability/benchmark/runRmiBench.sh generic-all
            Hide
            tyan Tristan Yan (Inactive) added a comment -
            Hi Tristan,

            (cc'ing Mark Sheppard, as he's working in the RMI area as well.)

            There is already logic in the java/rmi/testlibrary/TestLibrary class (see
            getUnusedRandomPort) to choose a random port. Unfortunately, this test is a shell script, and the random port choosing logic is in Java.

            For other reasons we're trying to move away from shell script tests.

            So probably the best way to deal with this test is to rewrite it in Java. Have the test be in Java, and have it choose a random port, and then start the server in the same JVM. Then fork another JVM to be the client side and to run the benchmark.

            This lets us use the random port choosing logic, and it also avoids the "sleep 10" in the shell script which is intended to wait until the server is ready before starting the client.
            Show
            tyan Tristan Yan (Inactive) added a comment - Hi Tristan, (cc'ing Mark Sheppard, as he's working in the RMI area as well.) There is already logic in the java/rmi/testlibrary/TestLibrary class (see getUnusedRandomPort) to choose a random port. Unfortunately, this test is a shell script, and the random port choosing logic is in Java. For other reasons we're trying to move away from shell script tests. So probably the best way to deal with this test is to rewrite it in Java. Have the test be in Java, and have it choose a random port, and then start the server in the same JVM. Then fork another JVM to be the client side and to run the benchmark. This lets us use the random port choosing logic, and it also avoids the "sleep 10" in the shell script which is intended to wait until the server is ready before starting the client.
            Hide
            tyan Tristan Yan (Inactive) added a comment - - edited
            Root Cause:
            java/rmi/reliability/benchmark fails intermittently because of use of fixed port.

            Suggested Fix:
            Based on my research, it looks like the issue of fixed port was already addressed by Stuart Marks in other RMI tests which are Java based. I would like to reuse his solution, however it does not work for shell based tests. Given this,
             
            1. Fixing the shell based test to address this bug may not be the best solution
            2. My recommendation would be to convert this shell script test into Java based test and re-use the dynamic port allocation solution by Stuart Marks to address the issue
            3. Also this test was written with server/client mode in shell script. In the past there have been sync issues between server/client which caused the test to fail. If we convert the shell script into Java based test, it would avoid using "sleep 10" mechanism to allow for server and client to start up and also give us better control in synchronizing server and client.
            Show
            tyan Tristan Yan (Inactive) added a comment - - edited Root Cause: java/rmi/reliability/benchmark fails intermittently because of use of fixed port. Suggested Fix: Based on my research, it looks like the issue of fixed port was already addressed by Stuart Marks in other RMI tests which are Java based. I would like to reuse his solution, however it does not work for shell based tests. Given this,   1. Fixing the shell based test to address this bug may not be the best solution 2. My recommendation would be to convert this shell script test into Java based test and re-use the dynamic port allocation solution by Stuart Marks to address the issue 3. Also this test was written with server/client mode in shell script. In the past there have been sync issues between server/client which caused the test to fail. If we convert the shell script into Java based test, it would avoid using "sleep 10" mechanism to allow for server and client to start up and also give us better control in synchronizing server and client.
            Hide
            smarks Stuart Marks added a comment -
            To be fair, the unique port allocation stuff was added by Darryl Mocek.
            Show
            smarks Stuart Marks added a comment - To be fair, the unique port allocation stuff was added by Darryl Mocek.
            Show
            tyan Tristan Yan (Inactive) added a comment - Suggested fix sent to openjdk alias http://mail.openjdk.java.net/pipermail/core-libs-dev/2013-October/022786.html
            Hide
            hgupdate HG Updates added a comment -
            URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/df819e356901
            User: smarks
            Date: 2013-12-03 22:36:22 +0000
            Show
            hgupdate HG Updates added a comment - URL: http://hg.openjdk.java.net/jdk8/tl/jdk/rev/df819e356901 User: smarks Date: 2013-12-03 22:36:22 +0000
            Hide
            hgupdate HG Updates added a comment -
            URL: http://hg.openjdk.java.net/jdk8/jdk8/jdk/rev/df819e356901
            User: lana
            Date: 2013-12-10 18:28:32 +0000
            Show
            hgupdate HG Updates added a comment - URL: http://hg.openjdk.java.net/jdk8/jdk8/jdk/rev/df819e356901 User: lana Date: 2013-12-10 18:28:32 +0000

              People

              • Assignee:
                tyan Tristan Yan (Inactive)
                Reporter:
                smarks Stuart Marks
              • Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: