Github user Ben-Zvi commented on a diff in the pull request:

    https://github.com/apache/drill/pull/585#discussion_r79255636
  
    --- Diff: 
exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/xsort/ExternalSortBatch.java
 ---
    @@ -592,11 +592,14 @@ public BatchGroup 
mergeAndSpill(LinkedList<BatchGroup> batchGroups) throws Schem
           }
           injector.injectChecked(context.getExecutionControls(), 
INTERRUPTION_WHILE_SPILLING, IOException.class);
           newGroup.closeOutputStream();
    -    } catch (Exception e) {
    +    } catch (Throwable e) {
           // we only need to cleanup newGroup if spill failed
    -      AutoCloseables.close(e, newGroup);
    +      try {
    +        AutoCloseables.close(e, newGroup);
    +      } catch (Throwable t) { /* close() may hit the same IO issue; just 
ignore */ }
    --- End diff --
    
    In the case of no disk space to spill, close() tries to cleanup by calling 
flushBuffer() which eventually throws the same exception as there's still no 
space:
    
    at java.io.FileOutputStream.write(FileOutputStream.java:326)
          at 
org.apache.hadoop.fs.RawLocalFileSystem$LocalFSFileOutputStream.write(RawLocalFileSystem.java:246)
          at 
java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:82)
          at java.io.BufferedOutputStream.write(BufferedOutputStream.java:126)
          - locked <0x24e5> (a java.io.BufferedOutputStream)
          at 
org.apache.hadoop.fs.FSDataOutputStream$PositionCache.write(FSDataOutputStream.java:58)
          at java.io.DataOutputStream.write(DataOutputStream.java:107)
          - locked <0x24e7> (a org.apache.hadoop.fs.FSDataOutputStream)
          at 
org.apache.hadoop.fs.ChecksumFileSystem$ChecksumFSOutputSummer.writeChunk(ChecksumFileSystem.java:419)
          at 
org.apache.hadoop.fs.FSOutputSummer.writeChecksumChunks(FSOutputSummer.java:206)
          at 
org.apache.hadoop.fs.FSOutputSummer.flushBuffer(FSOutputSummer.java:163)
          - locked <0x24e8> (a 
org.apache.hadoop.fs.ChecksumFileSystem$ChecksumFSOutputSummer)
          at 
org.apache.hadoop.fs.FSOutputSummer.flushBuffer(FSOutputSummer.java:144)
          at 
org.apache.hadoop.fs.ChecksumFileSystem$ChecksumFSOutputSummer.close(ChecksumFileSystem.java:407)
          at 
org.apache.hadoop.fs.FSDataOutputStream$PositionCache.close(FSDataOutputStream.java:72)
          at 
org.apache.hadoop.fs.FSDataOutputStream.close(FSDataOutputStream.java:106)
          at 
org.apache.drill.exec.physical.impl.xsort.BatchGroup.close(BatchGroup.java:169)
          at 
org.apache.drill.common.AutoCloseables.close(AutoCloseables.java:76)
          at 
org.apache.drill.common.AutoCloseables.close(AutoCloseables.java:53)
          at 
org.apache.drill.common.AutoCloseables.close(AutoCloseables.java:43)
          at 
org.apache.drill.exec.physical.impl.xsort.ExternalSortBatch.mergeAndSpill(ExternalSortBatch.java:598)



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to