SLIDER-394 slider client and AM services to fail-fast if the hadoop dependencies are missing
Project: http://git-wip-us.apache.org/repos/asf/incubator-slider/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-slider/commit/8034012f Tree: http://git-wip-us.apache.org/repos/asf/incubator-slider/tree/8034012f Diff: http://git-wip-us.apache.org/repos/asf/incubator-slider/diff/8034012f Branch: refs/heads/feature/SLIDER-280_Restart_AM_fun_tests Commit: 8034012f2f0282c9dbab814a282ab47abc175204 Parents: 0f67b10 Author: Steve Loughran <ste...@apache.org> Authored: Thu Sep 4 16:37:05 2014 +0100 Committer: Steve Loughran <ste...@apache.org> Committed: Thu Sep 4 16:37:05 2014 +0100 ---------------------------------------------------------------------- .../slider/server/appmaster/SliderAppMaster.java | 3 +++ .../server/services/workflow/LongLivedProcess.java | 16 +++++++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/8034012f/slider-core/src/main/java/org/apache/slider/server/appmaster/SliderAppMaster.java ---------------------------------------------------------------------- diff --git a/slider-core/src/main/java/org/apache/slider/server/appmaster/SliderAppMaster.java b/slider-core/src/main/java/org/apache/slider/server/appmaster/SliderAppMaster.java index 9ccb382..49c7792 100644 --- a/slider-core/src/main/java/org/apache/slider/server/appmaster/SliderAppMaster.java +++ b/slider-core/src/main/java/org/apache/slider/server/appmaster/SliderAppMaster.java @@ -400,6 +400,9 @@ public class SliderAppMaster extends AbstractSliderLaunchedService //look at settings of Hadoop Auth, to pick up a problem seen once checkAndWarnForAuthTokenProblems(); + + // validate server env + SliderUtils.validateSliderServerEnvironment(log); executorService = new WorkflowExecutorService<ExecutorService>("AmExecutor", Executors.newCachedThreadPool( http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/8034012f/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 6f83811..a0df2c9 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 @@ -24,6 +24,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.io.BufferedReader; +import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStreamReader; import java.util.ArrayList; @@ -292,7 +293,20 @@ public class LongLivedProcess implements Runnable { if (LOG.isDebugEnabled()) { LOG.debug("Spawning process:\n " + describeBuilder()); } - process = processBuilder.start(); + try { + process = processBuilder.start(); + } catch (IOException e) { + // on windows, upconvert DOS error 2 from ::CreateProcess() + // to its real meaning: FileNotFound + if (e.toString().contains("CreateProcess error=2")) { + FileNotFoundException fnfe = + new FileNotFoundException(e.toString()); + fnfe.initCause(e); + throw fnfe; + } else { + throw e; + } + } return process; }