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

Pavel Rappo prappo at openjdk.org
Thu Mar 16 21:25:47 UTC 2023


On Thu, 16 Mar 2023 21:21:51 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:
> 
>   Making the test for orTimeout+completeExceptionally only based on iterations and not duration.

test/jdk/java/util/concurrent/CompletableFuture/CompletableFutureOrTimeoutExceptionallyTest.java line 2:

> 1: /*
> 2:  * Copyright (c) 2019, 2023, Oracle and/or its affiliates. All rights reserved.

2019?

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

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


More information about the core-libs-dev mailing list