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

Jaikiran Pai jpai at openjdk.org
Mon Mar 20 13:54:03 UTC 2023


On Fri, 17 Mar 2023 09:52: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:
> 
>   Reformatting the while-body to be more legible in diffs, and inlining the counter incrementation.

Hello Viktor, I'll sponsor this shortly. It's my understanding that changes to these classes are also expected to be synced to the jsr166 repo that Doug maintains. From the description in this PR, I'm guessing that Doug will be doing this change in the jsr166 repo as well?

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

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


More information about the core-libs-dev mailing list