You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@drill.apache.org by ja...@apache.org on 2015/05/15 08:42:51 UTC

[05/17] drill git commit: DRILL-3063: TestQueriesOnLargeFile leaks memory with 16M limit Changed the cleanup handling at the end of ImplCreator.getExec(), and handle the newly returned null value in FragmentExecutor.run().

DRILL-3063: TestQueriesOnLargeFile leaks memory with 16M limit
Changed the cleanup handling at the end of ImplCreator.getExec(), and
handle the newly returned null value in FragmentExecutor.run().


Project: http://git-wip-us.apache.org/repos/asf/drill/repo
Commit: http://git-wip-us.apache.org/repos/asf/drill/commit/e58a3063
Tree: http://git-wip-us.apache.org/repos/asf/drill/tree/e58a3063
Diff: http://git-wip-us.apache.org/repos/asf/drill/diff/e58a3063

Branch: refs/heads/master
Commit: e58a30638fd7fc700b1e93d05503ddb7a7b76643
Parents: bef60f5
Author: Chris Westin <cw...@yahoo.com>
Authored: Thu May 14 15:53:05 2015 -0700
Committer: Jacques Nadeau <ja...@apache.org>
Committed: Thu May 14 21:58:52 2015 -0700

----------------------------------------------------------------------
 .../apache/drill/exec/physical/impl/ImplCreator.java   | 13 ++++++-------
 .../drill/exec/work/fragment/FragmentExecutor.java     |  3 +++
 2 files changed, 9 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/drill/blob/e58a3063/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/ImplCreator.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/ImplCreator.java b/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/ImplCreator.java
index 77ca0f5..66558be 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/ImplCreator.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/ImplCreator.java
@@ -77,7 +77,6 @@ public class ImplCreator {
     Stopwatch watch = new Stopwatch();
     watch.start();
 
-    boolean success = false;
     try {
       final RootExec rootExec = creator.getRootExec(root, context);
       // skip over this for SimpleRootExec (testing)
@@ -91,15 +90,15 @@ public class ImplCreator {
             "The provided fragment did not have a root node that correctly created a RootExec value.");
       }
 
-      success = true;
       return rootExec;
-    } finally {
-      if (!success) {
-        for(final CloseableRecordBatch crb : creator.getOperators()) {
-          AutoCloseables.close(crb, logger);
-        }
+    } catch(Exception e) {
+      context.fail(e);
+      for(final CloseableRecordBatch crb : creator.getOperators()) {
+        AutoCloseables.close(crb, logger);
       }
     }
+
+    return null;
   }
 
   /** Create RootExec and its children (RecordBatches) for given FragmentRoot */

http://git-wip-us.apache.org/repos/asf/drill/blob/e58a3063/exec/java-exec/src/main/java/org/apache/drill/exec/work/fragment/FragmentExecutor.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/work/fragment/FragmentExecutor.java b/exec/java-exec/src/main/java/org/apache/drill/exec/work/fragment/FragmentExecutor.java
index 8c49d68..ffb76b1 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/work/fragment/FragmentExecutor.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/work/fragment/FragmentExecutor.java
@@ -226,6 +226,9 @@ public class FragmentExecutor implements Runnable {
               drillbitContext.getPlanReader().readFragmentOperator(fragment.getFragmentJson());
 
           root = ImplCreator.getExec(fragmentContext, rootOperator);
+          if (root == null) {
+            return;
+          }
 
           clusterCoordinator.addDrillbitStatusListener(drillbitStatusListener);
           updateState(FragmentState.RUNNING);