JFR SwapSpace event might read wrong free swap space size

XMLWordPrintable

    • b02
    • generic
    • linux

        I've just observed a test failure on a cgroups v2 test system where the containers/docker/TestJFREvents.java test failed with:

        ----------System.err:(12/674)----------
        java.lang.Exception: Found free size value is bad
                at TestJFREvents.testSwapMemory(TestJFREvents.java:257)
                at TestJFREvents.main(TestJFREvents.java:84)
                at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
                at java.base/java.lang.reflect.Method.invoke(Method.java:580)
                at com.sun.javatest.regtest.agent.MainWrapper$MainTask.run(MainWrapper.java:138)
                at java.base/java.lang.Thread.run(Thread.java:1575)

        JavaTest Message: Test threw exception: java.lang.Exception: Found free size value is bad

        Upon further looking the test contained this output too:

        ------------------------->8-------------------
        Found freeSize value 6207565824 is bad
        ------------------------->8-------------------

        The events that got recorded looked like this:

        ===== EventType: jdk.SwapSpace
        startTime = 893777303
        totalSize = 104857600
        freeSize = 6207565824
        ===== EventType: jdk.SwapSpace
        startTime = 895074451
        totalSize = 104857600
        freeSize = 104857600

        Note that this particular test system has 6207565824 as the host free swap size value. However, the totalSize got already recorded as
        104857600 (which is the container limit value).

        Therefore, the code needs to be fixed to never report more than the totalSize value (which might be a containerized value).

        It's not clear to me why we ended up in this state however. Nevertheless this is a bug and should be fixed. JDK-8325139 was the original bug that introduced this.

              Assignee:
              Matthias Baesken
              Reporter:
              Severin Gehwolf
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: