You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@drill.apache.org by bo...@apache.org on 2019/09/26 21:00:13 UTC
[drill] branch master updated: DRILL-7170: Ignore uninitialized
vector containers for OOM error messages
This is an automated email from the ASF dual-hosted git repository.
boaz pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/drill.git
The following commit(s) were added to refs/heads/master by this push:
new d2645c7 DRILL-7170: Ignore uninitialized vector containers for OOM error messages
d2645c7 is described below
commit d2645c7638a88a4afd162bc3f1e2d65353ca3a67
Author: Ben-Zvi <bb...@mapr.com>
AuthorDate: Wed Sep 25 17:27:13 2019 -0700
DRILL-7170: Ignore uninitialized vector containers for OOM error messages
---
.../apache/drill/exec/physical/impl/common/HashTableTemplate.java | 6 +++++-
.../java/org/apache/drill/exec/physical/impl/spill/SpillSet.java | 7 +++++--
2 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/common/HashTableTemplate.java b/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/common/HashTableTemplate.java
index d0789e8..b549a9e 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/common/HashTableTemplate.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/common/HashTableTemplate.java
@@ -459,7 +459,11 @@ public abstract class HashTableTemplate implements HashTable {
size += ledger.getAccountedSize();
}
- size += new RecordBatchSizer(htContainer).getActualSize();
+ // In some rare cases (e.g., making a detailed debug msg after an OOM) the container
+ // was not initialized; ignore such cases
+ if ( htContainer.hasRecordCount() ) {
+ size += new RecordBatchSizer(htContainer).getActualSize();
+ }
return size;
}
}
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/spill/SpillSet.java b/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/spill/SpillSet.java
index 3a2e668..a06ce09 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/spill/SpillSet.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/spill/SpillSet.java
@@ -324,8 +324,11 @@ public class SpillSet {
@Override
public void deleteDir(String fragmentSpillDir) throws IOException {
- boolean deleted = new File(baseDir, fragmentSpillDir).delete();
- if ( ! deleted ) { throw new IOException("Failed to delete: " + fragmentSpillDir);}
+ File spillDir = new File(baseDir, fragmentSpillDir);
+ for (File spillFile : spillDir.listFiles()) {
+ spillFile.delete(); // IO exception if file delete fails
+ }
+ spillDir.delete();// IO exception if dir delete fails
}
@Override