From 723b08735192895b4a8972c0a8b1a49bb7aae33f Mon Sep 17 00:00:00 2001 From: Jungtaek Lim Date: Thu, 24 Mar 2016 16:45:24 +0900 Subject: [PATCH] STORM-1655 Flux doesn't set return code to non-zero when there's any exception while deploying topology to remote cluster * Modify Flux.runCli() to not catching exceptions so that exception can be propagated to main() --- .../main/java/org/apache/storm/flux/Flux.java | 22 ++++++++----------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/external/flux/flux-core/src/main/java/org/apache/storm/flux/Flux.java b/external/flux/flux-core/src/main/java/org/apache/storm/flux/Flux.java index cdebd01c62a..5848d2fb2c5 100644 --- a/external/flux/flux-core/src/main/java/org/apache/storm/flux/Flux.java +++ b/external/flux/flux-core/src/main/java/org/apache/storm/flux/Flux.java @@ -159,20 +159,16 @@ private static void runCli(CommandLine cmd)throws Exception { if(!cmd.hasOption(OPTION_DRY_RUN)) { if (cmd.hasOption(OPTION_REMOTE)) { LOG.info("Running remotely..."); - try { - // should the topology be active or inactive - SubmitOptions submitOptions = null; - if(cmd.hasOption(OPTION_INACTIVE)){ - LOG.info("Deploying topology in an INACTIVE state..."); - submitOptions = new SubmitOptions(TopologyInitialStatus.INACTIVE); - } else { - LOG.info("Deploying topology in an ACTIVE state..."); - submitOptions = new SubmitOptions(TopologyInitialStatus.ACTIVE); - } - StormSubmitter.submitTopology(topologyName, conf, topology, submitOptions, null); - } catch (Exception e) { - LOG.warn("Unable to deploy topology to remote cluster.", e); + // should the topology be active or inactive + SubmitOptions submitOptions = null; + if(cmd.hasOption(OPTION_INACTIVE)){ + LOG.info("Deploying topology in an INACTIVE state..."); + submitOptions = new SubmitOptions(TopologyInitialStatus.INACTIVE); + } else { + LOG.info("Deploying topology in an ACTIVE state..."); + submitOptions = new SubmitOptions(TopologyInitialStatus.ACTIVE); } + StormSubmitter.submitTopology(topologyName, conf, topology, submitOptions, null); } else { LOG.info("Running in local mode...");