RFR: 8367319: Add os interfaces to get machine and container values separately [v5]
David Holmes
dholmes at openjdk.org
Wed Dec 10 07:31:33 UTC 2025
On Tue, 9 Dec 2025 16:50:08 GMT, Erik Österlund <eosterlund at openjdk.org> wrote:
>> The way you would respond to an actual failure to read a cgroup file would be completely different to how you respond to there being no limit. Defining a sentinel value to represent "no limit" would make perfect sense for this API in my opinion.
>
> As a user of this API, I don't see what I would do about there being an error reading a limit, vs reading that there is a limit which does not do any actual limiting. In both cases I act as if there is no container limit I can use and fall back to looking st machine limits. Maybe it's a lack of imagination, but I don't know what else I'm supposed to do.
>
> If complaining in a log or something is the answer, then I'd prefer such complaints to be inside of the implementation instead of having the user do that.
Based on that you would not want errors to be reported at all. I was expecting at least logging on error or perhaps some kind of "abort" if the error signifies a fatal condition for what you are trying to do. Maybe errors are so unlikely that we really don't care? But I would not assume an error means there is no limit and proceed on that basis - YMMV.
But I will step aside from the discussion.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/27646#discussion_r2605509918
More information about the hotspot-dev
mailing list