RFR: JDK-8315026: java/lang/ProcessHandle/TreeTest.java fails intermittent on AIX in TreeTest.test5 [v4]

Joachim Kern jkern at openjdk.org
Wed Oct 11 12:10:12 UTC 2023


On Wed, 11 Oct 2023 11:22:21 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:

>> Joachim Kern has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   cosmetic changes 2
>
> src/java.base/aix/native/libjava/ProcessHandleImpl_aix.c line 43:
> 
>> 41: /*
>> 42:  * Returns the children of the requested pid and optionally each parent and
>> 43:  * start time. If requested pid is zero return all processes.
> 
> This deserves at least a better explanation, because I was first wondering why you return the parent pid since that would be just, well, the pid. Then I thought "oh, maybe he traverses indirect children too, then returning the respective parent pid would make sense". And then I saw that no, you only return direct children *unless* pid is 0. So the parent pid business makes only sense for the pid==0 case.
> 
> So, from looking at the implementation, the only point of the parent pid return array is if you pass in 0 as pid. This should be made clearer. Or even better, split this into two functions, one "get children(pid, returnpidarray)" and one "getAllProcesses(returnarray, ppid returnarray)".

Hi Thomas, this function is just the same as the linux and macos implementation. And I do not want to make more changes as really needed, otherwise the siblings character gets lost. Following your proposal means to do the split for linux and macos too. And to be honest, I do not really know the intention of the function, maybe the implementation is wrong on all platforms. So my goal was to only exchange the used API and keep everything else as on linux. This is my defensive approach.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/16051#discussion_r1354862596


More information about the core-libs-dev mailing list