On Thu, 12 Nov 2026 14:55:25 GMT, Viktor Klang <[email protected]> wrote:

> One possible venue of exception propagation is to ferry the exception to the 
> Relay's task (presuming that it hasn't already been completed). This PR adds 
> a regression test to ensure that exceptions are propagated for all the 
> different modes of sorting.
> 
> One potential open question here is whether Arrays.parallelSort(…, 
> Comparator) might need a CSR or not.
> 
> 
> 
> ---------
> - [x] I confirm that I make this contribution in accordance with the [OpenJDK 
> Interim AI Policy](https://openjdk.org/legal/ai).

src/java.base/share/classes/java/util/ArraysParallelSortHelpers.java line 109:

> 107:             // completed is to return true here and say that propagation 
> is still needed
> 108:             if (task.isDone())
> 109:                 return true;

@DougLea I'm not sure this can reasonably occur, but also, since Relay doesn't 
have a completer, it is unclear what ought to happen here.

src/java.base/share/classes/java/util/ArraysParallelSortHelpers.java line 115:

> 113:             // we can do in this case.
> 114:             task.completeExceptionally(ex);
> 115:             return false;

@DougLea I'm a bit on the fence as to whether this should always return true or 
false, given that it is impossible to obtain a clear answer as to whether the 
`completeExceptionally`-call succeeded or not. On the other hand, the return 
value of this method is unlikely to lead to any difference in outcome as there 
is no completer to the Relay.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/33878#discussion_r4552384432
PR Review Comment: https://git.openjdk.org/jdk/pull/33878#discussion_r4552423020

Reply via email to