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

Fast-fail if output stream Id is null

    XMLWordPrintableJSON

Details

    Description

      If we accidentally set null to output stream Id and end up with the code like:

      @Override
          public void declareOutputFields(OutputFieldsDeclarer declarer) {
            declarer.declareStream(null, new Fields("word", "count"));
          }
      

      We could get the following exception:

      java.lang.NullPointerException
      	at org.apache.thrift.protocol.TBinaryProtocol.writeString(TBinaryProtocol.java:200)
      	at org.apache.storm.generated.ComponentCommon$ComponentCommonStandardScheme.write(ComponentCommon.java:739)
      	at org.apache.storm.generated.ComponentCommon$ComponentCommonStandardScheme.write(ComponentCommon.java:636)
      	at org.apache.storm.generated.ComponentCommon.write(ComponentCommon.java:556)
      	at org.apache.storm.generated.Bolt$BoltStandardScheme.write(Bolt.java:477)
      	at org.apache.storm.generated.Bolt$BoltStandardScheme.write(Bolt.java:427)
      	at org.apache.storm.generated.Bolt.write(Bolt.java:362)
      	at org.apache.storm.generated.StormTopology$StormTopologyStandardScheme.write(StormTopology.java:1483)
      	at org.apache.storm.generated.StormTopology$StormTopologyStandardScheme.write(StormTopology.java:1254)
      	at org.apache.storm.generated.StormTopology.write(StormTopology.java:1110)
      	at org.apache.storm.generated.Nimbus$submitTopology_args$submitTopology_argsStandardScheme.write(Nimbus.java:7676)
      	at org.apache.storm.generated.Nimbus$submitTopology_args$submitTopology_argsStandardScheme.write(Nimbus.java:7601)
      	at org.apache.storm.generated.Nimbus$submitTopology_args.write(Nimbus.java:7528)
      	at org.apache.thrift.TServiceClient.sendBase(TServiceClient.java:71)
      	at org.apache.thrift.TServiceClient.sendBase(TServiceClient.java:62)
      	at org.apache.storm.generated.Nimbus$Client.send_submitTopology(Nimbus.java:304)
      	at org.apache.storm.generated.Nimbus$Client.submitTopology(Nimbus.java:293)
      	at org.apache.storm.StormSubmitter.submitTopologyInDistributeMode(StormSubmitter.java:332)
      	at org.apache.storm.StormSubmitter.submitTopologyAs(StormSubmitter.java:266)
      	at org.apache.storm.StormSubmitter.submitTopology(StormSubmitter.java:393)
      	at org.apache.storm.StormSubmitter.submitTopology(StormSubmitter.java:165)
      	at org.apache.storm.topology.ConfigurableTopology.submit(ConfigurableTopology.java:94)
      	at org.apache.storm.starter.WordCountTopology.run(WordCountTopology.java:100)
      	at org.apache.storm.topology.ConfigurableTopology.start(ConfigurableTopology.java:70)
      	at org.apache.storm.starter.WordCountTopology.main(WordCountTopology.java:79)
      

      It's because null in map is not supported by thrift. We should check stream Id not null here

      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