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

Race condition in CompletableFuture.thenCompose with asynchronous task

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • P3
    • Resolution: Fixed
    • 8
    • 8
    • core-libs

    Backports

      Description

        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.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                  Created:
                  Updated:
                  Resolved: