Github user Ben-Zvi commented on a diff in the pull request:
https://github.com/apache/drill/pull/585#discussion_r79267883
--- 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 --
The root cause for the whole bug is in Hadoop's RawLocalFileSystem.java:
package org.apache.hadoop.fs;
.....
public void write(byte[] b, int off, int len) throws IOException {
try {
fos.write(b, off, len);
} catch (IOException e) { // unexpected exception
throw new FSError(e); // assume native fs error
}
}
And FSError is not a subclass of IOException !!!
java.lang.Object
java.lang.Throwable
java.lang.Error
org.apache.hadoop.fs.FSError
So the only common ancestor is Throwable . And any part in the drill code
that catches only IOException will not catch !!
---
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 [email protected] or file a JIRA ticket
with INFRA.
---