drill-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s..@apache.org
Subject [1/6] drill git commit: DRILL-3051: Fix integer overflow in TimedRunnable
Date Wed, 13 May 2015 02:42:50 GMT
Repository: drill
Updated Branches:
  refs/heads/master 6d7cda8ea -> 83d8ebe60


DRILL-3051: Fix integer overflow in TimedRunnable

also fixes a similar overflow in Foreman


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

Branch: refs/heads/master
Commit: 83d8ebe60d9e5e8c5b842dff223f87739aea0a6c
Parents: b3d097b
Author: Steven Phillips <smp@apache.org>
Authored: Tue May 12 18:19:49 2015 -0700
Committer: Steven Phillips <smp@apache.org>
Committed: Tue May 12 18:21:10 2015 -0700

----------------------------------------------------------------------
 .../java/org/apache/drill/exec/store/TimedRunnable.java |  2 +-
 .../org/apache/drill/exec/work/foreman/Foreman.java     |  2 +-
 .../org/apache/drill/exec/store/TestTimedRunnable.java  | 12 ++++++++++++
 3 files changed, 14 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/drill/blob/83d8ebe6/exec/java-exec/src/main/java/org/apache/drill/exec/store/TimedRunnable.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/store/TimedRunnable.java b/exec/java-exec/src/main/java/org/apache/drill/exec/store/TimedRunnable.java
index e52820b..240aaef 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/store/TimedRunnable.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/store/TimedRunnable.java
@@ -41,7 +41,7 @@ import com.google.common.collect.Lists;
  */
 public abstract class TimedRunnable<V> implements Runnable {
 
-  private static int TIMEOUT_PER_RUNNABLE_IN_MSECS = 15000;
+  private static long TIMEOUT_PER_RUNNABLE_IN_MSECS = 15000;
 
   private volatile Exception e;
   private volatile long timeNanos;

http://git-wip-us.apache.org/repos/asf/drill/blob/83d8ebe6/exec/java-exec/src/main/java/org/apache/drill/exec/work/foreman/Foreman.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/work/foreman/Foreman.java
b/exec/java-exec/src/main/java/org/apache/drill/exec/work/foreman/Foreman.java
index af3309f..cdf1276 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/work/foreman/Foreman.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/work/foreman/Foreman.java
@@ -109,7 +109,7 @@ public class Foreman implements Runnable {
   private static final org.slf4j.Logger queryLogger = org.slf4j.LoggerFactory.getLogger("query.logger");
   private static final ObjectMapper MAPPER = new ObjectMapper();
   private final static ExecutionControlsInjector injector = ExecutionControlsInjector.getInjector(Foreman.class);
-  private static final int RPC_WAIT_IN_MSECS_PER_FRAGMENT = 5000;
+  private static final long RPC_WAIT_IN_MSECS_PER_FRAGMENT = 5000;
 
   private final QueryId queryId;
   private final RunQuery queryRequest;

http://git-wip-us.apache.org/repos/asf/drill/blob/83d8ebe6/exec/java-exec/src/test/java/org/apache/drill/exec/store/TestTimedRunnable.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/test/java/org/apache/drill/exec/store/TestTimedRunnable.java
b/exec/java-exec/src/test/java/org/apache/drill/exec/store/TestTimedRunnable.java
index 2807c35..44bb8b6 100644
--- a/exec/java-exec/src/test/java/org/apache/drill/exec/store/TestTimedRunnable.java
+++ b/exec/java-exec/src/test/java/org/apache/drill/exec/store/TestTimedRunnable.java
@@ -100,4 +100,16 @@ public class TestTimedRunnable extends DrillTest {
         containsString("Waited for 93750ms, but tasks for 'Execution with some tasks triggering
timeout' are not " +
             "complete. Total runnable size 100, parallelism 16."));
   }
+
+  @Test
+  public void withManyTasks() throws Exception {
+
+    List<TimedRunnable<TestTask>> tasks = Lists.newArrayList();
+
+    for (int i = 0; i < 150000; i++) {
+      tasks.add(new TestTask(0));
+    }
+
+    TimedRunnable.run("Execution with lots of tasks", logger, tasks, 16);
+  }
 }


Mime
View raw message