On Tue, 12 Nov 2024 19:09:54 GMT, Sergey Chernyshev <schernys...@openjdk.org> 
wrote:

> > Edit: Yet, cg v2 will get into trouble since there, for example on rootless 
> > podman on cg v2 you'd end up with this instead:
> > ```
> > [0.008s][trace][os,container] OSContainer::init: Initializing Container 
> > Support
> > [0.008s][debug][os,container] Detected optional pids controller entry in 
> > /proc/cgroups
> > [0.008s][debug][os,container] Detected cgroups v2 unified hierarchy
> > [0.008s][trace][os,container] Adjusting controller path for memory: 
> > /sys/fs/cgroup/../../../../../../test
> > [0.008s][trace][os,container] Path to /memory.max is 
> > /sys/fs/cgroup/../../../../../../test/memory.max
> > [0.008s][debug][os,container] Open of file 
> > /sys/fs/cgroup/../../../../../../test/memory.max failed, No such file or 
> > directory
> > [0.008s][trace][os,container] Memory Limit failed: -2
> > ...
> > [0.009s][trace][os,container] Path to /memory.max is 
> > /sys/fs/cgroup/memory.max
> > [0.009s][debug][os,container] Open of file /sys/fs/cgroup/memory.max 
> > failed, No such file or directory
> > [0.009s][trace][os,container] Memory Limit failed: -2
> > [0.009s][trace][os,container] Memory Limit is: -2
> > ```
> 
> Here, the path `/sys/fs/cgroup/memory.max` would normally point to the actual 
> memory limit inside the container. In this particular case, the directory 
> `/sys/fs/cgroup` is empty.

Yes. I believe we need to issue a `warning` log message if the `cgroup_path` 
includes `../` mentioning that memory limits might be wrong. There is nothing 
more we can do here.

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

PR Comment: https://git.openjdk.org/jdk/pull/21808#issuecomment-2471414814

Reply via email to