RFR: 8287107: CgroupSubsystemFactory.setCgroupV2Path asserts with freezer controller [v2]

Severin Gehwolf sgehwolf at openjdk.java.net
Tue May 24 19:39:04 UTC 2022


On Tue, 24 May 2022 16:09:54 GMT, Ioi Lam <iklam at openjdk.org> wrote:

>> src/java.base/linux/classes/jdk/internal/platform/CgroupSubsystemFactory.java line 155:
>> 
>>> 153:                 // There are some controllers (such as freezer) that Java doesn't
>>> 154:                 // care about. Just ignore them. These are not considered in the
>>> 155:                 // anyCgroupsV1Controller/anyCgroupsV1Controller checks.
>> 
>> It's not clear why this `default` is necessary. Could we just add the comment like so:
>> 
>> 
>> // Intentional fall-through. There are controllers (such as freezer) that
>> // Java doesn't care about. Just ignore them. Only listed controllers are
>> // considered in the anyCgroupsV1Controller/anyCgroupsV2Controller checks.
>
> This is not a fall-through because the previous line ends with a `break`.

My bad. How about `Intentional incomplete switch. There are ...`? Anyway, why is the empty `default` case needed other than for the comment?

-------------

PR: https://git.openjdk.java.net/jdk/pull/8858


More information about the core-libs-dev mailing list