RFR: 8367319: Add os interfaces to get machine and container values separately [v5]

Casper Norrbin cnorrbin at openjdk.org
Tue Dec 9 10:05:13 UTC 2025


On Mon, 8 Dec 2025 05:53:49 GMT, David Holmes <dholmes at openjdk.org> wrote:

> I think that should be guaranteed. This is our API we can make it as strict as we desire. If I have preset a sentinel value and the op fails then I should be able to rely on my sentinel remaining intact.

>From the feedback I've changed so returning `false` now doesn't change the value, so we keep that assumption.

> But now you are overloading the use of the return value. It was intended to reflect success or failure, not provide semantic information. The higher-level function can choose to return true when there is a limit and false when there is not, but it can't also mean "or an error occurred".

I'd argue that in this context, we fail (and should return `false`) when we can't find a limit. When a caller asks the generic `Container` layer for a limit and none is found, "no limit" isn't a meaningful limit to report. Not finding a limit is the failure here, not being unable to read a cgroup file.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/27646#discussion_r2601922557


More information about the hotspot-dev mailing list