> On Feb. 20, 2024, 4:43 a.m., Benjamin Mahler wrote: > > src/linux/cgroups2.hpp > > Lines 83-96 (patched) > > <https://reviews.apache.org/r/74874/diff/1/?file=2285175#file2285175line83> > > > > hm.. this doesn't seem needed? the below can just be: > > > > ``` > > Try<Nothing> write( > > const string& cgroup, > > const string& control, > > const string& value) > > { > > return os::write( > > path::join(*cgroups2::rootMountPoint, cgroup, control), > > value); > > ```
The justification is explained in the comment. TLDR: The path needs to be normalized. The suggested code could result in a write to <root>//<control> instead of the desired <root>/<control>. - Devin ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/74874/#review226225 ----------------------------------------------------------- On Feb. 12, 2024, 5:05 p.m., Devin Leamy wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/74874/ > ----------------------------------------------------------- > > (Updated Feb. 12, 2024, 5:05 p.m.) > > > Review request for mesos. > > > Repository: mesos > > > Description > ------- > > Introduces: > - `cgroups2::read()`: Read a control file to a string. > - `cgroups2::write()`: Write a string to a control file. > reading and writing primitives for controls. > > > Diffs > ----- > > src/linux/cgroups2.hpp PRE-CREATION > src/linux/cgroups2.cpp PRE-CREATION > > > Diff: https://reviews.apache.org/r/74874/diff/1/ > > > Testing > ------- > > > Thanks, > > Devin Leamy > >
