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

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

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.8.1
    • 3.0.0-beta1
    • test
    • 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

              stevel@apache.org Steve Loughran
              stevel@apache.org Steve Loughran
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: