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

MP FT retry.callsSucceededRetried.total metric has wrong value

XMLWordPrintable

    • Hide

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

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

      When method annotated with @Fallback and @Retry fails, MP FT retry.callsSucceededRetried.total metric even though the method fails everytime and falls into a fallback method.

      The issue is only in the metric. The method is retried as expected and 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#L76

      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/159

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

                Created:
                Updated:
                Resolved: