Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8029164

Race condition in CompletableFuture.thenCompose with asynchronous task

XMLWordPrintable

        When composing completable futures using thenCompose a race condition is possible if:

        1) the composing future completes before or during the call to thenCompose; and
        2) the composing function returns a CompletedFuture that is executed asynchronously and does not complete during the call to thenCompose.

        Under such conditions the composed future's result will be null and the result produced by the composing function's CompletableFuture will be discarded when it completes.

              psandoz Paul Sandoz
              psandoz Paul Sandoz
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: