RFR: 8307990: jspawnhelper must close its writing side of a pipe before reading from it [v3]

Volker Simonis simonis at openjdk.org
Mon May 22 07:24:56 UTC 2023


On Wed, 17 May 2023 17:08:34 GMT, Roger Riggs <rriggs at openjdk.org> wrote:

>> Volker Simonis has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   REALLY adding the test :)
>
> test/jdk/java/lang/ProcessBuilder/JspawnhelperProtocol.java line 116:
> 
>> 114:         int ret = p.exitValue();
>> 115:         if (ret == 0) {
>> 116:             throw new Exception("Expected error in child execution");
> 
> Mixing the two styles of error reporting seems a bit odd, some throw exceptions and others just exit.
> Being consistent throwing an exception with a message would be better.

Good point. Changed the exits to exceptions except in `childCode()` where we need `System.exit()` in order to communicate different error states back to the parent process.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/13956#discussion_r1200069183


More information about the core-libs-dev mailing list