Github user revans2 commented on a diff in the pull request:

    https://github.com/apache/incubator-storm/pull/18#discussion_r11607023
  
    --- Diff: storm-core/src/clj/backtype/storm/daemon/supervisor.clj ---
    @@ -447,22 +452,31 @@
               stormjar (supervisor-stormjar-path stormroot)
               storm-conf (read-supervisor-storm-conf conf storm-id)
               classpath (add-to-classpath (current-classpath) [stormjar])
    -          childopts (.replaceAll (str (conf WORKER-CHILDOPTS) " " 
(storm-conf TOPOLOGY-WORKER-CHILDOPTS))
    -                                 "%ID%"
    -                                 (str port))
    +          worker-childopts (when-let [s (conf WORKER-CHILDOPTS)]
    +                             (substitute-worker-childopts s port))
    +          topo-worker-childopts (when-let [s (storm-conf 
TOPOLOGY-WORKER-CHILDOPTS)]
    +                                  (substitute-worker-childopts s port))
               logfilename (str "worker-" port ".log")
    -          command (str "java -server " childopts
    -                       " -Djava.library.path=" (conf JAVA-LIBRARY-PATH)
    -                       " -Dlogfile.name=" logfilename
    -                       " -Dstorm.home=" storm-home
    -                       " -Dlogback.configurationFile=" storm-home 
"/logback/cluster.xml"
    -                       " -Dstorm.id=" storm-id
    -                       " -Dworker.id=" worker-id
    -                       " -Dworker.port=" port
    -                       " -cp " classpath " backtype.storm.daemon.worker "
    -                       (java.net.URLEncoder/encode storm-id) " " 
(:assignment-id supervisor)
    -                       " " port " " worker-id)]
    -      (log-message "Launching worker with command: " command)
    +          command (concat
    +                    ["java" "-server"]
    +                    worker-childopts
    +                    topo-worker-childopts
    +                    [(str "-Djava.library.path=" (conf JAVA-LIBRARY-PATH))
    +                     (str "-Dlogfile.name=" logfilename)
    +                     (str "-Dstorm.home=" storm-home)
    +                     (str "-Dlogback.configurationFile=" storm-home 
"/logback/cluster.xml")
    +                     (str "-Dstorm.id=" storm-id)
    +                     (str "-Dworker.id=" worker-id)
    +                     (str "-Dworker.port=" port)
    +                     "-cp" classpath
    +                     "backtype.storm.daemon.worker"
    +                     storm-id
    +                     (:assignment-id supervisor)
    +                     port
    +                     worker-id])
    +          command (->> command (map str) (filter (complement empty?)))
    +          shell-cmd (->> command (map #(str \' % \')) (clojure.string/join 
" "))]
    --- End diff --
    
    We are surrounding arguments with a tick \' but we are not escaping any \' 
in the command.  This is probably not critical, and it is juts logged, but it 
would probably be good to do. 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to