RFR 8029164: Race condition in CompletableFuture.thenCompose with asynchronous task

Paul Sandoz paul.sandoz at oracle.com
Wed Nov 27 11:02:14 UTC 2013




This fixes an issue with CompletableFuture.thenCompose.  

If the composing future is already completed before the call to thenCompose (or completes during some part of the call to thenCompose) and the composing function returns a future that is not yet completed then there is race to set the result, usually won by thenCompose which incorrectly sets the result to null, due to an errant conditional statement.

Doug has reviewed and committed the fix to the 166 repo and we have double checked there are no similar errors lurking in other areas of CompletableFuture code.


More information about the core-libs-dev mailing list