[ 
https://issues.apache.org/jira/browse/STORM-1157?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15008976#comment-15008976
 ] 

ASF GitHub Bot commented on STORM-1157:
---------------------------------------

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

    https://github.com/apache/storm/pull/842#discussion_r45083275
  
    --- Diff: storm-core/src/clj/backtype/storm/ui/core.clj ---
    @@ -986,6 +1021,127 @@
             (log-message "Setting topology " id " log config " new-log-config)
             (.setLogConfig nimbus id new-log-config)
             (json-response (log-config id) (m "callback")))))
    +
    +  (GET "/api/v1/topology/:id/profiling/start/:host-port/:timeout"
    +       [:as {:keys [servlet-request]} id host-port timeout & m]
    +       (thrift/with-configured-nimbus-connection nimbus
    +         (let [user (.getUserName http-creds-handler servlet-request)
    +               topology-conf (from-json
    +                              (.getTopologyConf ^Nimbus$Client nimbus id))]
    +           (assert-authorized-user "setWorkerProfiler" (topology-config 
id))
    +           (assert-authorized-profiler-action "start"))
    +
    +         (let [[host, port] (split host-port #":")
    +               nodeinfo (NodeInfo. host (set [(Long. port)]))
    +               timestamp (+ (System/currentTimeMillis) (* 60000 (Long. 
timeout)))
    +               request (ProfileRequest. nodeinfo
    +                                        ProfileAction/JPROFILE_STOP)]
    +           (.set_time_stamp request timestamp)
    +           (.setWorkerProfiler nimbus id request)
    +           (json-response {"status" "ok"
    +                           "id" host-port
    +                           "timeout" timeout
    +                           "dumplink" (worker-dump-link
    +                                       host
    +                                       port
    +                                       id)}
    +                          (m "callback")))))
    +
    +  (GET "/api/v1/topology/:id/profiling/stop/:host-port"
    --- End diff --
    
    As rest of the communication between nimbus and supervisor for assignments 
- going through ZK answers all Thread concurrency issues. As user ProfileAction 
is written to ZK by nimbus ( which performs 2 phase commit). The supervisor can 
read old value or new depending on whether it reads is before or after the 
commit phase.. The supervisor reads it every 30 seconds. 


> Dynamic Worker Profiler - jmap, jstack, profiling and restarting worker
> -----------------------------------------------------------------------
>
>                 Key: STORM-1157
>                 URL: https://issues.apache.org/jira/browse/STORM-1157
>             Project: Apache Storm
>          Issue Type: Improvement
>          Components: storm-core
>            Reporter: Kishor Patil
>            Assignee: Kishor Patil
>             Fix For: 0.11.0
>
>
> In multi-tenant mode, storm launches long-running JVMs across cluster without 
> sudo access to user. Self-serving of Java heap-dumps, jstacks and java 
> profiling of these JVMs would improve users' ability to analyze and debug 
> issues when monitoring it actively.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to