Uploaded image for project: 'WildFly'
  1. WildFly
  2. WFLY-12924

MP FT fallback metric is incremented wrongly

    XMLWordPrintable

Details

    • Hide

      build WildFly
      clone git@github.com:istraka/eap-microprofile-test-suite.git branch mp-ft-metrics-reproducer
      run the Reproducers#fallbackCounter test:

      mvn clean verify -pl tooling-server-configuration,microprofile-health  -Djboss.home=_path_to_wf_ -DfailIfNoTests=false -Dtest=Reproducers#fallbackCounter
      
      Show
      build WildFly clone git@github.com:istraka/eap-microprofile-test-suite.git branch mp-ft-metrics-reproducer run the Reproducers#fallbackCounter test: mvn clean verify -pl tooling-server-configuration,microprofile-health -Djboss.home=_path_to_wf_ -DfailIfNoTests=false -Dtest=Reproducers #fallbackCounter

    Description

      When method annotated with @Fallback and @Retry fails, MP FT fallback counter metric (fallback.calls.total) is incremented by 2. Meaning if the method fails N times (due to @Retry) fallback is invoked and the metric is 2.

      The issue is only in the metric. Fallback method is invoked only once as expected.

      Reproducer:
      https://github.com/istraka/eap-microprofile-test-suite/blob/mp-ft-metrics-reproducer/microprofile-health/src/test/java/org/jboss/eap/qe/microprofile/health/integration/Reproducers.java#L111

      CDI Bean:

          @Fallback(fallbackMethod = "isReadyFallback")
          @Retry(maxRetries = MAX_RETRIES)
          public boolean isReady() throws IOException {
              service.simulateOpeningResources();
              return ready.get();
          }
      
          public boolean isReadyFallback() {
              return readyInMainenance.get();
          }
      
          @Counted(name = "simulation-count", absolute = true, displayName = "Simulation Count", description = "Number of simulateOpeningResources invocations", reusable = true)
          public void simulateOpeningResources() throws IOException {
              if (inMaintanance.get()) {
                  throw new IOException("In maintanance");
              }
          }
      

      https://github.com/istraka/eap-microprofile-test-suite/blob/mp-ft-metrics-reproducer/microprofile-health/src/main/java/org/jboss/eap/qe/microprofile/health/integration/FailSafeDummyService.java#L47

      Smallrye issue
      https://github.com/smallrye/smallrye-fault-tolerance/issues/158

      Attachments

        Issue Links

          Activity

            People

              rhn-engineering-rhusar Radoslav Husar
              istraka@redhat.com Ivan Straka
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: