RFR: JDK-8303742: CompletableFuture.orTimeout leaks if the future completes exceptionally [v4]

Jaikiran Pai jpai at openjdk.org
Fri Mar 17 09:05:10 UTC 2023


On Fri, 17 Mar 2023 08:59:37 GMT, Viktor Klang <duke at openjdk.org> wrote:

>> Addresses the situation where exceptional completion of `orTimeout`:ed CompletableFutures wouldn't cancel the timeout task which could lead to memory leaks if done frequently enough with long enough timeout durations.
>> 
>> Fix discussed with @DougLea
>
> Viktor Klang has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Adding a test for completeOnTimeout cancelling tasks when completeExceptionally

Thank you Viktor for the updates. This looks good to me.

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

Marked as reviewed by jpai (Reviewer).

PR: https://git.openjdk.org/jdk/pull/13059


More information about the core-libs-dev mailing list