From 48846355b42714925586b549eab11de62c365a5c Mon Sep 17 00:00:00 2001 From: Boaz Ben-Zvi Date: Fri, 9 Sep 2016 16:36:03 -0700 Subject: [PATCH] DRILL-3898 : Sort spill was modified to catch all errors, ignore repeated errors while closing the new group and issue a more detailed error message. --- .../drill/exec/physical/impl/xsort/ExternalSortBatch.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/xsort/ExternalSortBatch.java b/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/xsort/ExternalSortBatch.java index c88bd4b5776..54aa72d70c5 100644 --- a/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/xsort/ExternalSortBatch.java +++ b/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/xsort/ExternalSortBatch.java @@ -592,11 +592,14 @@ public BatchGroup mergeAndSpill(LinkedList 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 */ } throw UserException.resourceError(e) .message("External Sort encountered an error while spilling to disk") + .addContext(e.getMessage() /* more detail */) .build(logger); } finally { hyperBatch.clear();