Uploaded image for project: 'Hadoop Common'
  1. Hadoop Common
  2. HADOOP-14851

LambdaTestUtils.eventually() doesn't spin on Assertion failures

VotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.8.1
    • Fix Version/s: 3.0.0-beta1
    • Component/s: test
    • Labels:
      None

      Description

      This is funny. The LsmbdaTestUtils.eventually() method, meant to spin until a closure stops raising exceptions, doesn't catch Error and subclasses, so doesn't fail on an Assert.assert() failure, which raises an AssertionError. My bad

      Example:

          eventually(TIMEOUT,
              () -> {
                while (counter.incrementAndGet()  < 5) {
                  assert false : "oops";
                }
              },
              retryLogic);
      

      Fix: catch Throwable, rethrow. Needs to add VirtualMachineError & subclasses to the set of errors not to spin on (OOM, stack overflow, ...)

        Attachments

        1. HADOOP-14851-001.patch
          9 kB
          Steve Loughran
        2. HADOOP-14851-002.patch
          12 kB
          Steve Loughran
        3. HADOOP-14851-003.patch
          12 kB
          Aaron Fabbri

        Issue Links

          Activity

            People

            • Assignee:
              stevel@apache.org Steve Loughran
              Reporter:
              stevel@apache.org Steve Loughran

              Dates

              • Created:
                Updated:
                Resolved:

                Issue deployment