Uploaded image for project: 'JBoss Enterprise Application Platform'
  1. JBoss Enterprise Application Platform
  2. JBEAP-16333

(7.2.z) WFTC-60 - SubordinateXAResource#getRemainingTime is not calculating the remaining time correctly

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Verified (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: 7.2.1.CR1, 7.2.1.GA
    • Component/s: None
    • Labels:
      None

      Description

      The current calculation of the remaining time for a SubordinateXAResource is incorrect because it is assuming that the elapsed time is in microseconds when it is in nanoseconds.

      The current calculation is done using:

        int getRemainingTime() {
              long elapsed = max(0L, System.nanoTime() - startTime);
              final int capturedTimeout = this.capturedTimeout;
              return capturedTimeout - (int) min(capturedTimeout, elapsed / 1_000_000L);
          }
      

      However, System.nanoTime() is in nanoseconds, so we have to divide by 1_000_000_000L in order to get seconds to compare with the capturedTimeout.

      Since WFTC-54, an exception is thrown if the remaining timeout is up, which is affecting one of the tests in wildfly, see WFLY-11670 for more information.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              spyrkob Bartosz Spyrko-Smietanko
              Reporter:
              spyrkob Bartosz Spyrko-Smietanko
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: