Uploaded image for project: 'Thorntail'
  1. Thorntail
  2. THORN-1945

MP fault tolerance: @CircuitBreaker doesn't work when the method is @Asynchronous

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: 2018.3.3
    • Fix Version/s: 2018.5.0
    • Component/s: microprofile
    • Labels:
      None

      Description

      If I have an @Asynchronous method with @CircuitBreaker and all the invocations fails, the circuit breaker never opens. This is because in the async case, the only thing that happens is that the command is submitted for execution (and the submission is an operation that will succeed), a HystrixCommandInterceptor.AsyncFuture is created as a result of the operation, syncCircuitBreaker.executionSucceeded() is called and the AsyncFuture is returned.

      This happens in both failure modes: if the @Asynchronous method throws (synchronously) an exception, or if the @Asynchronous method returns a failed Future.

      The MP FT spec is a little ambiguous. Chapter 4.1. Asynchronous Usage says:

      The @Asynchronous annotation can be used together with @Timeout, @Fallback, @Bulkhead and @Retry.

      While chapter 8.1. Circuit Breaker Usage says:

      The @CircuitBreaker annotation can be used together with @Timeout, @Fallback, @Asynchronous, @Bulkhead and @Retry.

      If the intention was for @CircuitBreaker to not be usable with @Asynchronous, that would be understandable, but it's not clear.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  mkouba Martin Kouba
                  Reporter:
                  lthon Ladislav Thon
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  5 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: