drill-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jacq...@apache.org
Subject [4/6] drill git commit: DRILL-2898: Update fragment executor to capture OutOfMemory exceptions and report instead of terminating thread.
Date Wed, 29 Apr 2015 07:30:52 GMT
DRILL-2898: Update fragment executor to capture OutOfMemory exceptions and report instead of
terminating thread.


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

Branch: refs/heads/master
Commit: 4a23037a6c1d03f872f1b86ed91d189d93ee036f
Parents: 5f50c24
Author: Jacques Nadeau <jacques@apache.org>
Authored: Tue Apr 28 21:31:01 2015 -0700
Committer: Jacques Nadeau <jacques@apache.org>
Committed: Wed Apr 29 00:28:44 2015 -0700

----------------------------------------------------------------------
 .../drill/exec/work/fragment/FragmentExecutor.java    | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/drill/blob/4a23037a/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 0701252..0783fee 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
@@ -26,6 +26,7 @@ import org.apache.drill.common.DeferredException;
 import org.apache.drill.common.concurrent.ExtendedLatch;
 import org.apache.drill.common.exceptions.UserException;
 import org.apache.drill.exec.coord.ClusterCoordinator;
+import org.apache.drill.exec.memory.OutOfMemoryRuntimeException;
 import org.apache.drill.exec.ops.FragmentContext;
 import org.apache.drill.exec.ops.FragmentContext.ExecutorState;
 import org.apache.drill.exec.physical.base.FragmentRoot;
@@ -204,6 +205,19 @@ public class FragmentExecutor implements Runnable {
       });
 
       updateState(FragmentState.FINISHED);
+    } catch (OutOfMemoryError | OutOfMemoryRuntimeException e) {
+      if (!(e instanceof OutOfMemoryError) || "Direct buffer memory".equals(e.getMessage()))
{
+        fail(UserException.resourceError(e)
+            .message("One or more nodes ran out of memory while executing the query.")
+            .build());
+      } else {
+        // we have a heap out of memory error. The JVM in unstable, exit.
+        System.err.println("Node ran out of Heap memory, exiting.");
+        e.printStackTrace(System.err);
+        System.err.flush();
+        System.exit(-2);
+
+      }
     } catch (AssertionError | Exception e) {
       fail(e);
     } finally {


Mime
View raw message