Ethanlm commented on a change in pull request #3322:
URL: https://github.com/apache/storm/pull/3322#discussion_r482346087



##########
File path: storm-client/src/jvm/org/apache/storm/StormSubmitter.java
##########
@@ -235,7 +237,14 @@ public static void submitTopologyAs(String name, 
Map<String, Object> topoConf, S
         conf.putAll(topoConf);
         topoConf.putAll(prepareZookeeperAuthentication(conf));
 
-        validateConfs(conf, topology, name);
+        validateConfs(conf);
+
+        try {
+            StormCommon.validateCycleFree(topology, name);
+        } catch (InvalidTopologyException ex) {
+            LOG.warn(ex.get_msg(), ex);

Review comment:
       Right. So the log will look like 
   ```
   19:22:23.981 [main] WARN  o.a.s.StormSubmitter - Topology wc contains cycles 
in components "count,split"
   org.apache.storm.generated.InvalidTopologyException: null
        at 
org.apache.storm.daemon.StormCommon.validateCycleFree(StormCommon.java:596) 
~[storm-client-2.3.0-SNAPSHOT.jar:2.3.0-SNAPSHOT]
        at 
org.apache.storm.StormSubmitter.submitTopologyAs(StormSubmitter.java:244) 
[storm-client-2.3.0-SNAPSHOT.jar:2.3.0-SNAPSHOT]
        at 
org.apache.storm.StormSubmitter.submitTopology(StormSubmitter.java:214) 
[storm-client-2.3.0-SNAPSHOT.jar:2.3.0-SNAPSHOT]
        at 
org.apache.storm.StormSubmitter.submitTopology(StormSubmitter.java:177) 
[storm-client-2.3.0-SNAPSHOT.jar:2.3.0-SNAPSHOT]
        at 
org.apache.storm.topology.ConfigurableTopology.submit(ConfigurableTopology.java:119)
 [storm-client-2.3.0-SNAPSHOT.jar:2.3.0-SNAPSHOT]
        at 
org.apache.storm.starter.WordCountTopology.run(WordCountTopology.java:58) 
[storm-starter-2.3.0-SNAPSHOT.jar:2.3.0-SNAPSHOT]
        at 
org.apache.storm.topology.ConfigurableTopology.start(ConfigurableTopology.java:68)
 [storm-client-2.3.0-SNAPSHOT.jar:2.3.0-SNAPSHOT]
        at 
org.apache.storm.starter.WordCountTopology.main(WordCountTopology.java:36) 
[storm-starter-2.3.0-SNAPSHOT.jar:2.3.0-SNAPSHOT]
   ```
   
   
   We can probably use 
[WrappedInvalidTopologyException](https://github.com/apache/storm/blob/master/storm-client/src/jvm/org/apache/storm/utils/WrappedInvalidTopologyException.java)
 inside `validateCycleFree` method so the stacktrace will make more sense. What 
do you think? 
   It will be like 
   ```
   org.apache.storm.utils.WrappedInvalidTopologyException: Topology wc2 
contains cycles in components "count,split"
        at 
org.apache.storm.daemon.StormCommon.validateCycleFree(StormCommon.java:596) 
~[storm-client-2.3.0-SNAPSHOT.jar:2.3.0-SNAPSHOT]
        .....
   ```
   




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to