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

Using more than one Stream.filter inside a CompletableFuture hangs

    XMLWordPrintable

    Details

    • Subcomponent:
    • CPU:
      generic
    • OS:
      generic

      Description

      ADDITIONAL SYSTEM INFORMATION :
      Adopt Open JDK 11 to Adopt Open JDK 15

      A DESCRIPTION OF THE PROBLEM :
      When using `thenApply` in a `CompletableFuture` and calling a method in the `thenApply` that happens to use a `Stream` and *two* filters, a deadlock occurs.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      1. Clone https://github.com/dhinojosa/bug-httpclient-stream
      2. Either run:
          a. mvn clean compile exec:java -Dexec.mainClass="com.xyzcorp.httpclient.Runner"
          b. mvn test
      3. Notice the deadlock
      4. Goto CountryFunctions#findLanguagesByRegion
      5. Comment out one of the filters, there will be no more deadlock
      6. Comment out both filters, there will also be no more deadlock

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Should run
      ACTUAL -
      Deadlock

      FREQUENCY : always


        Attachments

          Activity

            People

            Assignee:
            dfuchs Daniel Fuchs
            Reporter:
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated: