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

Joachim Kern jkern at openjdk.org
Thu Oct 12 09:37:19 UTC 2023


On Thu, 12 Oct 2023 06:30:33 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 89:
> 
>> 87: 
>> 88:     do { // Block to break out of on Exception
>> 89:         pids = (*env)->GetLongArrayElements(env, jarray, NULL);
> 
> Nit, I'd move these invocations of GLAE into the initialization block and remove the outer loop. I see what you do here, the outer block gives you a reliable jumping point to get cleanup in case of an error. But I would just use a goto cleanup label. That's clearer and allows you to handle initialization in one place.
> 
> Proposal for initialization:
> 
> 
> if (jparentArray != null) {
>   - check size is same as primary array, if wrong throw + goto cleanup
>   - ppids = GLAE
> } else {
>   - if input pid is 0, throw an error too, since for "get all processes mode"
>       we need the parent array. Throw + goto cleanup.
> }
> // same for times array

hmm? As I already mentioned I do not want to change the structure of the function with this pr. This can be done by someone else for macos, linux and aix in parallel.

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

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


More information about the core-libs-dev mailing list