You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@slider.apache.org by sm...@apache.org on 2014/08/12 22:49:00 UTC

[7/9] git commit: SLIDER-311 jenkins TestWorkflowForkedProcessService failing with java.util.concurrent.RejectedExecutionException

SLIDER-311 jenkins TestWorkflowForkedProcessService failing with java.util.concurrent.RejectedExecutionException


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

Branch: refs/heads/feature/SLIDER-285_Restart_AM
Commit: a9be431b6b37fd18c2f0c82544964f845cd03ba7
Parents: cc37299
Author: Steve Loughran <st...@apache.org>
Authored: Tue Aug 12 15:32:03 2014 +0100
Committer: Sumit Mohanty <sm...@hortonworks.com>
Committed: Tue Aug 12 13:48:41 2014 -0700

----------------------------------------------------------------------
 .../slider/server/services/workflow/LongLivedProcess.java     | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/a9be431b/slider-core/src/main/java/org/apache/slider/server/services/workflow/LongLivedProcess.java
----------------------------------------------------------------------
diff --git a/slider-core/src/main/java/org/apache/slider/server/services/workflow/LongLivedProcess.java b/slider-core/src/main/java/org/apache/slider/server/services/workflow/LongLivedProcess.java
index ecc26b9..c8ff758 100644
--- a/slider-core/src/main/java/org/apache/slider/server/services/workflow/LongLivedProcess.java
+++ b/slider-core/src/main/java/org/apache/slider/server/services/workflow/LongLivedProcess.java
@@ -112,7 +112,7 @@ public class LongLivedProcess implements Runnable {
     this.processLog = processLog;
     ServiceThreadFactory factory = new ServiceThreadFactory(name, true);
     processExecutor = Executors.newSingleThreadExecutor(factory);
-    logExecutor=    Executors.newSingleThreadExecutor(factory);
+    logExecutor = Executors.newSingleThreadExecutor(factory);
     processBuilder = new ProcessBuilder(commands);
     processBuilder.redirectErrorStream(false);
   }
@@ -288,6 +288,7 @@ public class LongLivedProcess implements Runnable {
    */
   @Override // Runnable
   public void run() {
+    Preconditions.checkNotNull(process, "null process");
     LOG.debug("Lifecycle callback thread running");
     //notify the callback that the process has started
     if (lifecycleCallback != null) {
@@ -326,10 +327,10 @@ public class LongLivedProcess implements Runnable {
   public void start() throws IOException {
 
     spawnChildProcess();
-    processExecutor.submit(this);
     processStreamReader =
-      new ProcessStreamReader(processLog, STREAM_READER_SLEEP_TIME);
+        new ProcessStreamReader(processLog, STREAM_READER_SLEEP_TIME);
     logExecutor.submit(processStreamReader);
+    processExecutor.submit(this);
   }
 
   /**