RFR: 8287107: CgroupSubsystemFactory.setCgroupV2Path asserts with freezer controller [v2]
Ioi Lam
iklam at openjdk.java.net
Tue May 24 16:15:06 UTC 2022
On Tue, 24 May 2022 10:12:31 GMT, Severin Gehwolf <sgehwolf at openjdk.org> wrote:
>> Ioi Lam has updated the pull request incrementally with one additional commit since the last revision:
>>
>> @jerboaa comments
>
> 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`.
> src/java.base/linux/classes/jdk/internal/platform/CgroupSubsystemFactory.java line 229:
>
>> 227: String name = tokens[1];
>> 228: if (!name.equals("")) {
>> 229: // This is probably a v1 controller that we have ignored (e.g., freezer)
>
> Could we add an assertion that the controller isn't in the `infos` map?
>
> if (!name.equals("")) {
> // This must be a v1 controller that we have ignored (e.g., freezer)
> assert infos.get(name) == null;
> return;
> }
Fixed.
-------------
PR: https://git.openjdk.java.net/jdk/pull/8858
More information about the core-libs-dev
mailing list