RFR: 8313290: Misleading exception message from STS.Subtask::get when task forked after shutdown

Paul Sandoz psandoz at openjdk.org
Wed Aug 16 16:19:06 UTC 2023


On Fri, 28 Jul 2023 20:33:01 GMT, Alan Bateman <alanb at openjdk.org> wrote:

> This is a small issue with StructuredTaskScope. If the owner attempts to fork a subtask and the task scope is shutdown then the implementation doesn't currently force the owner to join when it's the first fork in a new round of forking. The result is that broken code calling Subtask::get throws ISE with the wrong exception message.
> 
> The existing test for this API is updated to remove a duplicate test and also fix two tasks that didn't call join.

Very minor suggestion, up to you. We could change the exception message thrown by `SubtaskImpl::get` to:

> Subtask result is unavailable or did not complete successfully

(Similar change for `SubtaskImpl::exception`.)
That leans into the terminology more.

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

Marked as reviewed by psandoz (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/15076#pullrequestreview-1580992012


More information about the core-libs-dev mailing list