Repository navigation
Open
Labels
Description
https://openj9-jenkins.osuosl.org/job/Test_openjdk11_j9_sanity.functional_ppc64le_linux_Nightly/234 - ub18-ppcle-1
testJITServer_0
Failed to properly start server, it terminated prematurely with exit value: 1
Dumping the contents of log file: /home/jenkins/workspace/Test_openjdk11_j9_sanity.functional_ppc64le_linux_Nightly_testList_1/aqa-tests/TKG/output_16469905706816/testJITServer_0/testServerComesUpAfterClientAndGoesDownAgain.server.out
////////////////////////////////////////////////////////////////////////
//// can't bind server address: Address already in use
////////////////////////////////////////////////////////////////////////
[JITServerTest] [INFO] running testServerGoesDown: INFO and above level logging enabled
[JITServerTest] [INFO] Chose random port for server: -XX:JITServerPort=56556, set JITServerTest_SERVER_PORT in your env to override.
[JITServerTest] [INFO] Starting server with command line:
/home/jenkins/workspace/Test_openjdk11_j9_sanity.functional_ppc64le_linux_Nightly_testList_1/openjdkbinary/j2sdk-image/bin/jitserver -XX:JITServerPort=56556
[JITServerTest] [INFO] With stdout/stderr redirected to:
/home/jenkins/workspace/Test_openjdk11_j9_sanity.functional_ppc64le_linux_Nightly_testList_1/aqa-tests/TKG/output_16469905706816/testJITServer_0/testServerGoesDown.server.out
[JITServerTest] [INFO] Starting client with command line:
/home/jenkins/workspace/Test_openjdk11_j9_sanity.functional_ppc64le_linux_Nightly_testList_1/openjdkbinary/j2sdk-image/bin/java -XX:JITServerPort=56556 -XX:+UseJITServer -Xcompressedrefs -Xjit -Xgcpolicy:gencon -cp /home/jenkins/workspace/Test_openjdk11_j9_sanity.functional_ppc64le_linux_Nightly_testList_1/aqa-tests/TKG/../../jvmtest/TestConfig/resources:/home/jenkins/workspace/Test_openjdk11_j9_sanity.functional_ppc64le_linux_Nightly_testList_1/aqa-tests/TKG/../TKG/lib/testng.jar:/home/jenkins/workspace/Test_openjdk11_j9_sanity.functional_ppc64le_linux_Nightly_testList_1/aqa-tests/TKG/../TKG/lib/jcommander.jar:/home/jenkins/workspace/Test_openjdk11_j9_sanity.functional_ppc64le_linux_Nightly_testList_1/aqa-tests/TKG/../../jvmtest/functional/JIT_Test/jitt.jar "-DjarTesterArgs=-loopforever /home/jenkins/workspace/Test_openjdk11_j9_sanity.functional_ppc64le_linux_Nightly_testList_1/aqa-tests/TKG/../../jvmtest/functional/JIT_Test/jitt.jar" org.testng.TestNG -d /home/jenkins/workspace/Test_openjdk11_j9_sanity.functional_ppc64le_linux_Nightly_testList_1/aqa-tests/TKG/../TKG/output_16469905706816/testJITServer_0/client /home/jenkins/workspace/Test_openjdk11_j9_sanity.functional_ppc64le_linux_Nightly_testList_1/aqa-tests/TKG/../../jvmtest/functional/JIT_Test/testng.xml -testnames JarTesterTest -groups level.sanity -excludegroups d.*.linux_ppc-64_le,d.*.arch.ppc,d.*.os.linux,d.*.bits.64,d.*.generic-all
[JITServerTest] [INFO] With stdout/stderr redirected to:
/home/jenkins/workspace/Test_openjdk11_j9_sanity.functional_ppc64le_linux_Nightly_testList_1/aqa-tests/TKG/output_16469905706816/testJITServer_0/testServerGoesDown.client.out
[JITServerTest] [INFO] Waiting for 45000 millis.
[JITServerTest] [INFO] Stopping server...
[JITServerTest] [INFO] Waiting for 45000 millis.
[JITServerTest] [INFO] Stopping client...
[JITServerTest] [INFO] running testServerGoesDownAnotherComesUp: INFO and above level logging enabled
[JITServerTest] [INFO] Chose random port for server: -XX:JITServerPort=41663, set JITServerTest_SERVER_PORT in your env to override.
[JITServerTest] [INFO] Starting server with command line:
/home/jenkins/workspace/Test_openjdk11_j9_sanity.functional_ppc64le_linux_Nightly_testList_1/openjdkbinary/j2sdk-image/bin/jitserver -XX:JITServerPort=41663
[JITServerTest] [INFO] With stdout/stderr redirected to:
/home/jenkins/workspace/Test_openjdk11_j9_sanity.functional_ppc64le_linux_Nightly_testList_1/aqa-tests/TKG/output_16469905706816/testJITServer_0/testServerGoesDownAnotherComesUp.server.out
[JITServerTest] [INFO] Starting client with command line:
/home/jenkins/workspace/Test_openjdk11_j9_sanity.functional_ppc64le_linux_Nightly_testList_1/openjdkbinary/j2sdk-image/bin/java -XX:JITServerPort=41663 -XX:+UseJITServer -Xcompressedrefs -Xjit -Xgcpolicy:gencon -cp /home/jenkins/workspace/Test_openjdk11_j9_sanity.functional_ppc64le_linux_Nightly_testList_1/aqa-tests/TKG/../../jvmtest/TestConfig/resources:/home/jenkins/workspace/Test_openjdk11_j9_sanity.functional_ppc64le_linux_Nightly_testList_1/aqa-tests/TKG/../TKG/lib/testng.jar:/home/jenkins/workspace/Test_openjdk11_j9_sanity.functional_ppc64le_linux_Nightly_testList_1/aqa-tests/TKG/../TKG/lib/jcommander.jar:/home/jenkins/workspace/Test_openjdk11_j9_sanity.functional_ppc64le_linux_Nightly_testList_1/aqa-tests/TKG/../../jvmtest/functional/JIT_Test/jitt.jar "-DjarTesterArgs=-loopforever /home/jenkins/workspace/Test_openjdk11_j9_sanity.functional_ppc64le_linux_Nightly_testList_1/aqa-tests/TKG/../../jvmtest/functional/JIT_Test/jitt.jar" org.testng.TestNG -d /home/jenkins/workspace/Test_openjdk11_j9_sanity.functional_ppc64le_linux_Nightly_testList_1/aqa-tests/TKG/../TKG/output_16469905706816/testJITServer_0/client /home/jenkins/workspace/Test_openjdk11_j9_sanity.functional_ppc64le_linux_Nightly_testList_1/aqa-tests/TKG/../../jvmtest/functional/JIT_Test/testng.xml -testnames JarTesterTest -groups level.sanity -excludegroups d.*.linux_ppc-64_le,d.*.arch.ppc,d.*.os.linux,d.*.bits.64,d.*.generic-all
[JITServerTest] [INFO] With stdout/stderr redirected to:
/home/jenkins/workspace/Test_openjdk11_j9_sanity.functional_ppc64le_linux_Nightly_testList_1/aqa-tests/TKG/output_16469905706816/testJITServer_0/testServerGoesDownAnotherComesUp.client.out
[JITServerTest] [INFO] Waiting for 45000 millis.
[JITServerTest] [INFO] Stopping server...
[JITServerTest] [INFO] Waiting for 45000 millis.
[JITServerTest] [INFO] Starting server with command line:
/home/jenkins/workspace/Test_openjdk11_j9_sanity.functional_ppc64le_linux_Nightly_testList_1/openjdkbinary/j2sdk-image/bin/jitserver -XX:JITServerPort=41663
[JITServerTest] [INFO] With stdout/stderr redirected to:
/home/jenkins/workspace/Test_openjdk11_j9_sanity.functional_ppc64le_linux_Nightly_testList_1/aqa-tests/TKG/output_16469905706816/testJITServer_0/testServerGoesDownAnotherComesUp.secondServer.out
[JITServerTest] [INFO] Waiting for 45000 millis.
[JITServerTest] [INFO] Stopping client...
[JITServerTest] [INFO] Stopping server...
[JITServerTest] [INFO] running testServerUnreachableForAWhile: INFO and above level logging enabled
[JITServerTest] [INFO] Chose random port for server: -XX:JITServerPort=52496, set JITServerTest_SERVER_PORT in your env to override.
[JITServerTest] [INFO] Starting server with command line:
/home/jenkins/workspace/Test_openjdk11_j9_sanity.functional_ppc64le_linux_Nightly_testList_1/openjdkbinary/j2sdk-image/bin/jitserver -XX:JITServerPort=52496
[JITServerTest] [INFO] With stdout/stderr redirected to:
/home/jenkins/workspace/Test_openjdk11_j9_sanity.functional_ppc64le_linux_Nightly_testList_1/aqa-tests/TKG/output_16469905706816/testJITServer_0/testServerUnreachableForAWhile.server.out
[JITServerTest] [INFO] Starting client with command line:
/home/jenkins/workspace/Test_openjdk11_j9_sanity.functional_ppc64le_linux_Nightly_testList_1/openjdkbinary/j2sdk-image/bin/java -XX:JITServerPort=52496 -XX:+UseJITServer -Xcompressedrefs -Xjit -Xgcpolicy:gencon -cp /home/jenkins/workspace/Test_openjdk11_j9_sanity.functional_ppc64le_linux_Nightly_testList_1/aqa-tests/TKG/../../jvmtest/TestConfig/resources:/home/jenkins/workspace/Test_openjdk11_j9_sanity.functional_ppc64le_linux_Nightly_testList_1/aqa-tests/TKG/../TKG/lib/testng.jar:/home/jenkins/workspace/Test_openjdk11_j9_sanity.functional_ppc64le_linux_Nightly_testList_1/aqa-tests/TKG/../TKG/lib/jcommander.jar:/home/jenkins/workspace/Test_openjdk11_j9_sanity.functional_ppc64le_linux_Nightly_testList_1/aqa-tests/TKG/../../jvmtest/functional/JIT_Test/jitt.jar "-DjarTesterArgs=-loopforever /home/jenkins/workspace/Test_openjdk11_j9_sanity.functional_ppc64le_linux_Nightly_testList_1/aqa-tests/TKG/../../jvmtest/functional/JIT_Test/jitt.jar" org.testng.TestNG -d /home/jenkins/workspace/Test_openjdk11_j9_sanity.functional_ppc64le_linux_Nightly_testList_1/aqa-tests/TKG/../TKG/output_16469905706816/testJITServer_0/client /home/jenkins/workspace/Test_openjdk11_j9_sanity.functional_ppc64le_linux_Nightly_testList_1/aqa-tests/TKG/../../jvmtest/functional/JIT_Test/testng.xml -testnames JarTesterTest -groups level.sanity -excludegroups d.*.linux_ppc-64_le,d.*.arch.ppc,d.*.os.linux,d.*.bits.64,d.*.generic-all
[JITServerTest] [INFO] With stdout/stderr redirected to:
/home/jenkins/workspace/Test_openjdk11_j9_sanity.functional_ppc64le_linux_Nightly_testList_1/aqa-tests/TKG/output_16469905706816/testJITServer_0/testServerUnreachableForAWhile.client.out
[JITServerTest] [INFO] Waiting for 45000 millis.
[JITServerTest] [INFO] Pausing server for 10000 millis.
[JITServerTest] [INFO] Resuming server...
[JITServerTest] [INFO] Waiting for 45000 millis.
[JITServerTest] [INFO] Stopping server...
[JITServerTest] [INFO] Waiting for 45000 millis.
[JITServerTest] [INFO] Stopping client...
PASSED: testServer
PASSED: testServerComesUpAfterClient
PASSED: testServerGoesDown
PASSED: testServerGoesDownAnotherComesUp
PASSED: testServerUnreachableForAWhile
FAILED: testServerComesUpAfterClientAndGoesDownAgain
java.lang.AssertionError: Failed to properly start server, it terminated prematurely with exit value: 1
at org.testng.AssertJUnit.fail(AssertJUnit.java:59)
at jit.test.jitserver.JITServerTest.startProcess(JITServerTest.java:271)
at jit.test.jitserver.JITServerTest.testServerComesUpAfterClientAndGoesDownAgain(JITServerTest.java:477)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:124)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:580)
at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:716)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:988)
at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:125)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:109)
at org.testng.TestRunner.privateRun(TestRunner.java:648)
at org.testng.TestRunner.run(TestRunner.java:505)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:455)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:450)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:415)
at org.testng.SuiteRunner.run(SuiteRunner.java:364)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:84)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1208)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1137)
at org.testng.TestNG.runSuites(TestNG.java:1049)
at org.testng.TestNG.run(TestNG.java:1017)
at org.testng.TestNG.privateMain(TestNG.java:1354)
at org.testng.TestNG.main(TestNG.java:1323)
Activity
mpirvu commentedon Mar 14, 2022
@cjjdespres Another JITServer failure with "//// can't bind server address: Address already in use".
We did modify the test to verify that the port is open before starting the server. I don't know what could be wrong.
cjjdespres commentedon Mar 14, 2022
That is odd. Maybe the method I used to detect whether or not the port is in use is insufficiently robust? I can look at it on ppc64le to see if it's a platform issue.
cjjdespres commentedon Mar 14, 2022
It's either that or a process managed to grab that port in the time between the check that it was free and the jitserver trying to claim it, which seems unlikely.
pshipton commentedon Mar 28, 2022
https://openj9-jenkins.osuosl.org/job/Test_openjdk18_j9_sanity.functional_x86-64_linux_Release_testList_1/7 - cent7-x64-5
cjjdespres commentedon Mar 30, 2022
I can confirm locally (by modifying the random port range to be a single value and having a separate JITServer instance use that port) that the port use detection works, at least in that scenario.
It's probably significant that the only part of the test that ever fails like this is
testServerComesUpAfterClientAndGoesDownAgain- I would expect another sub-test to fail at some point if the issue was only that the port use detection was unreliable. But the part of that test up to the point that the server is started is identical totestServerComesUpAfterClient, so it's unclear to me why only that test would fail like this.cjjdespres commentedon Apr 4, 2022
Since the failure doesn't seem to be happening at the point the port is queried, I could add the port info display to
dumpProcessLogin case this happens againcjjdespres commentedon May 18, 2022
https://hyc-runtimes-jenkins.swg-devops.com/job/Test_openjdk8_j9_sanity.functional_x86-64_linux_jit_Personal/957/,
test_JITServer_1. This time it wastestServerUnreachableForAWhile.pshipton commentedon Jul 11, 2022
https://openj9-jenkins.osuosl.org/job/Test_openjdk11_j9_sanity.functional_x86-64_linux_OMR_testList_1/257
cjjdespres commentedon Jul 19, 2022
Another failure in
/job/Test_openjdk8_j9_sanity.functional_x86-64_linux_jit_Personal/1015/.The "JITServer is ready to accept incoming requests" bit is a little odd; I thought that the "can't bind server address" error would halt JITServer startup before it got to that point.
pshipton commentedon Dec 7, 2022
https://openj9-jenkins.osuosl.org/job/Test_openjdk8_j9_sanity.functional_x86-64_linux_OMR_testList_0/349/
pshipton commentedon Dec 15, 2022
https://openj9-jenkins.osuosl.org/job/Test_openjdk19_j9_sanity.functional_x86-64_linux_Nightly_testList_1/69
testJITServer_0
pshipton commentedon Feb 1, 2023
https://openj9-jenkins.osuosl.org/job/Test_openjdk8_j9_sanity.functional_ppc64le_linux_OpenJDK8_testList_0/50
testJITServer_1
pshipton commentedon Mar 16, 2023
https://openj9-jenkins.osuosl.org/job/Test_openjdk19_j9_sanity.functional_ppc64le_linux_Nightly_testList_1/132
testJITServer_0
JasonFengJ9 commentedon Oct 6, 2023
JDK11 x86-64_linux milestone 2(
sles12x86-svl-rt3-1)JasonFengJ9 commentedon Jan 5, 2024
JDK21 x86-64_linux(
ubu20x86-svl-rt6-1)cjjdespres commentedon Jan 9, 2024
This happened again in https://hyc-runtimes-jenkins.swg-devops.com/job/Test_openjdk8_j9_sanity.functional_x86-64_linux_jit_Personal/1514/.
Looking at the code again, I see a few potential problems. First, there is the race condition in
JITServerTest.javathat has been noted before - we generate a random port that isn't in use, then pass that port tojitserverso it can listen on it. In between, a process might start using our port, causingjitserverstartup to fail. This problem also affectscriuJitServerScript.shandjitserverconfig.sh, which use a similar strategy to generate random ports for certain tests. This timing issue ought to be pretty rare, but maybe we run the tests enough that it happens with this frequency in practice.Second, the way we determine whether or not a port is available in
JITServerTest.javaisThe only way we return true is if the
tryblock throws anIOException, but I think that exception can be thrown bySocket()and byclose()if any IO error occurs, not just one resulting fromSocket()being unable to create a client connection because nothing is listening on the port. (Someone might want to confirm that - I'm not very familiar with Java networking). If so, that might result in a false positive in theisPortOpen()test, which might lead us to generate a random port number that's already in use.Third, we use
lsofto check networking stats, both inJITServerTest.javato see what process might be using our randomly-chosen port and inrandom_port()injitserverconfig.sh. The latter is responsible for finding random open ports incriuJitServerScript.shandjitserverScript.sh. According to https://stackoverflow.com/questions/49381124/what-are-the-differences-between-lsof-and-netstat-on-linux,lsofneeds to be run as root if you want reliable information about the usage of all the ports on a system. I don't know if tests are run as root or not, but if not, that might be an issue. One of the answers suggests usingnetstat -pluntorss -pluntinstead. (Thenetstatman page on my system says thatThis program is mostly obsolete. Replacement for netstat is ss., so maybessis the choice).cjjdespres commentedon Mar 21, 2024
I think there may be a robust solution to this. Well, two overlapping solutions.
Any test where the client is to connect to an already-running server can be fixed with Allow JITServer communication and health port 0Â #19184: the server can request an unused port for itself, and that port can be read from the server's logs and used to start the client. This is the "correct" way of doing this sort of thing, but doesn't work for tests where the client comes up before the server.
This is more speculative, but in any test (in particular ones where the client comes up without a server already running) we can have something bind to an unused port but not listen on it. This will reserve the port but won't count as having anything listening on it. This port can be used to start the client process, which should (hopefully) still fail to connect, since nothing is listening on the port. We can start the server with a special option (to be implemented) that will allow us to use
sendmsg()to transfer the socket to the server process over a unix socket, so the server can start listening on that port. (Or we do something involvingfork()). Whatever process bound the socket in the first place can retain a reference to it, so it can give it out again in those tests where the server is supposed to go down and come back up again.JasonFengJ9 commentedon May 21, 2024
JDK17 s390x_linux(
rtj-ubu24s390x-svl-test-6lslg-1)JasonFengJ9 commentedon May 30, 2025
openjdk11_j9_sanity.functional_aarch64_linux
JasonFengJ9 commentedon Apr 20, 2026
openjdk17_j9_sanity.functional_x86-64_linux
hzongaro commentedon Nov 11, 2026
Saw another instance of this in:
https://hyc-runtimes-jenkins.swg-devops.com/job/Test_openjdk11_j9_sanity.functional_x86-64_linux_Personal_testList_2/161/
https://hyc-runtimes-jenkins.swg-devops.com/job/Test_openjdk11_j9_sanity.functional_ppc64le_linux_Personal_testList_3/82/