Uploaded image for project: 'Apache Drill'
  1. Apache Drill
  2. DRILL-5083

RecordIterator can sometimes restart a query on close

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.8.0
    • 1.11.0
    • None

    Description

      This one is very confusing...

      In a test with a MergeJoin and external sort, operators are stacked something like this:

      Screen
      - MergeJoin
      - - External Sort
      ...
      

      Using the injector to force a OOM in spill, the external sort threw a UserException up the stack. This was handed by:

      IteratorValidatorBatchIterator.next( )
      RecordIterator.clearInflightBatches( )
      RecordIterator.close( )
      MergeJoinBatch.close( )
      

      Which does the following:

            // Check whether next() should even have been called in current state.
            if (null != exceptionState) {
              throw new IllegalStateException(
      

      But, the exceptionState is set, so we end up throwing an IllegalStateException during cleanup.

      Seems the code should agree: if next( ) will be called during cleanup, then next( ) should gracefully handle that case.

      Attachments

        1. DrillOperatorErrorHandlingRedesign.pdf
          191 kB
          Paul Rogers
        2. Reproduce5083.jpg
          306 kB
          Roman Kulyk

        Issue Links

          Activity

            People

              RomanKulyk Roman Kulyk
              paul-rogers Paul Rogers
              Khurram Faraaz Khurram Faraaz
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: