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

Alan Bateman alanb at openjdk.org
Thu Mar 16 19:35:19 UTC 2023


On Thu, 16 Mar 2023 13:37:10 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

The update to CF looks good. The test looks okay it as it fails in a few seconds without the change.

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

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


More information about the core-libs-dev mailing list