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

ProcessHandleImpl os_getChildren sysctl call - retry in case of ENOMEM and enhance exception message

XMLWordPrintable

    • b15
    • generic
    • generic

        In jtreg test java/lang/ProcessHandle/PermissionTest.java we run on macOS a few times into this error :

        java.lang.RuntimeException: Cannot allocate memory
               at java.base/java.lang.ProcessHandleImpl.getProcessPids0(Native Method)
               at java.base/java.lang.ProcessHandleImpl.children(ProcessHandleImpl.java:456)
               at java.base/java.lang.ProcessHandleImpl.children(ProcessHandleImpl.java:434)
               at PermissionTest.childrenWithPermission(PermissionTest.java:84)
               at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
               at java.base/java.lang.reflect.Method.invoke(Method.java:573)
               at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:132)
               at org.testng.internal.TestInvoker.invokeMethod(TestInvoker.java:599)
               at org.testng.internal.TestInvoker.invokeTestMethod(TestInvoker.java:174)
               at org.testng.internal.MethodRunner.runInSequence(MethodRunner.java:46)
               at org.testng.internal.TestInvoker$MethodInvocationAgent.invoke(TestInvoker.java:822)
               at org.testng.internal.TestInvoker.invokeTestMethods(TestInvoker.java:147)
               at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:146)
               at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:128)
               at java.base/java.util.ArrayList.forEach(ArrayList.java:1597)


        probably sysctl fails here, but it is not fully clear; it would help to change the exception so that the standard text is shown too.
        Also in case of ENOMEM, we can retry the failing sysctl call a few times.

              mbaesken Matthias Baesken
              mbaesken Matthias Baesken
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: