Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-5541

Missing null check for localJar in FlinkSubmitter#submitTopology()

    XMLWordPrintableJSON

Details

    Description

            if (localJar == null) {
              try {
                for (final URL url : ((ContextEnvironment) ExecutionEnvironment.getExecutionEnvironment())
                    .getJars()) {
                  // TODO verify that there is only one jar
                  localJar = new File(url.toURI()).getAbsolutePath();
                }
              } catch (final URISyntaxException e) {
                // ignore
              } catch (final ClassCastException e) {
                // ignore
              }
            }
      
            logger.info("Submitting topology " + name + " in distributed mode with conf " + serConf);
            client.submitTopologyWithOpts(name, localJar, topology);
      

      Since the try block may encounter URISyntaxException / ClassCastException, we should check that localJar is not null before calling submitTopologyWithOpts().

      Attachments

        Issue Links

          Activity

            People

              mingleizhang zhangminglei
              yuzhihong@gmail.com Ted Yu
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: