Uploaded image for project: 'Apache Storm'
  1. Apache Storm
  2. STORM-3619

Add null check for the topology name

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 2.2.0
    • None

    Description

      Currently with 

      StormSubmitter.submitTopology(null, ...)
      

       
      submission will fail:

      Exception in thread "main" java.lang.RuntimeException: org.apache.storm.thrift.TApplicationException: Internal error processing isTopologyNameAllowed
      	at org.apache.storm.StormSubmitter.topologyNameExists(StormSubmitter.java:438)
      	at org.apache.storm.StormSubmitter.submitTopologyAs(StormSubmitter.java:247)
      	at org.apache.storm.StormSubmitter.submitTopology(StormSubmitter.java:206)
      	at org.apache.storm.StormSubmitter.submitTopologyWithProgressBar(StormSubmitter.java:411)
      	at org.apache.storm.StormSubmitter.submitTopologyWithProgressBar(StormSubmitter.java:392)
      	at com.example.SimplifiedTwoCompTopology.main(SimplifiedTwoCompTopology.java:49)
      Caused by: org.apache.storm.thrift.TApplicationException: Internal error processing isTopologyNameAllowed
      	at org.apache.storm.thrift.TServiceClient.receiveBase(TServiceClient.java:79)
      	at org.apache.storm.generated.Nimbus$Client.recv_isTopologyNameAllowed(Nimbus.java:1209)
      	at org.apache.storm.generated.Nimbus$Client.isTopologyNameAllowed(Nimbus.java:1196)
      	at org.apache.storm.StormSubmitter.topologyNameExists(StormSubmitter.java:436)
      	... 5 more
      

      And on nimbus:

      2020-04-08 18:38:46.356 o.a.s.t.ProcessFunction pool-34-thread-475 [ERROR] Internal error processing isTopologyNameAllowed
      java.lang.NullPointerException: null
              at java.util.regex.Matcher.getTextLength(Matcher.java:1283) ~[?:1.8.0_242]
              at java.util.regex.Matcher.reset(Matcher.java:309) ~[?:1.8.0_242]
              at java.util.regex.Matcher.<init>(Matcher.java:229) ~[?:1.8.0_242]
              at java.util.regex.Pattern.matcher(Pattern.java:1093) ~[?:1.8.0_242]
              at org.apache.storm.daemon.nimbus.Nimbus.validateTopologyName(Nimbus.java:1189) ~[storm-server-2.2.0.y.jar:2.2.0.y]
              at org.apache.storm.daemon.nimbus.Nimbus.isTopologyNameAllowed(Nimbus.java:4667) ~[storm-server-2.2.0.y.jar:2.2.0.y]
              at org.apache.storm.generated.Nimbus$Processor$isTopologyNameAllowed.getResult(Nimbus.java:4423) ~[storm-client-2.2.0.y.jar:2.2.0.y]
              at org.apache.storm.generated.Nimbus$Processor$isTopologyNameAllowed.getResult(Nimbus.java:4402) ~[storm-client-2.2.0.y.jar:2.2.0.y]
              at org.apache.storm.thrift.ProcessFunction.process(ProcessFunction.java:38) [storm-shaded-deps-2.2.0.y.jar:2.2.0.y]
              at org.apache.storm.thrift.TBaseProcessor.process(TBaseProcessor.java:39) [storm-shaded-deps-2.2.0.y.jar:2.2.0.y]
              at org.apache.storm.security.auth.sasl.SaslTransportPlugin$TUGIWrapProcessor.process(SaslTransportPlugin.java:152) [storm-client-2.2.0.y
      .jar:2.2.0.y]
              at org.apache.storm.thrift.server.TThreadPoolServer$WorkerProcess.run(TThreadPoolServer.java:291) [storm-shaded-deps-2.2.0.y.jar:2.2.0.y
      ]
              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_242]
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_242]
              at java.lang.Thread.run(Thread.java:748) [?:1.8.0_242]
      

      This is because https://github.com/apache/storm/blob/v2.1.0/storm-server/src/main/java/org/apache/storm/daemon/nimbus/Nimbus.java#L1175-L1180

      the topology name is null so NullPointerException

      But the error message is not obvious. We should add null check when validating topology name and report the error indicating the topology name being null.

       

       

       

      Attachments

        Issue Links

          Activity

            People

              ethanli Ethan Li
              ethanli Ethan Li
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 1h
                  1h