[ https://issues.apache.org/jira/browse/STORM-532?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14174863#comment-14174863 ]
ASF GitHub Bot commented on STORM-532: -------------------------------------- Github user caofangkun commented on a diff in the pull request: https://github.com/apache/storm/pull/296#discussion_r19007702 --- Diff: storm-core/src/clj/backtype/storm/util.clj --- @@ -372,6 +372,13 @@ (throw (RuntimeException. (str "Got unexpected process name: " name)))) (first split))) +(defn exists-process? + [process-id] + (if on-windows? + (exec-command! ( str "tasklist /v /fi \"PID eq " process-id "\"")) --- End diff -- @itaifrenkel Thank you . == Check if process id 21320 exists, should return 0 == C:\Users\***>tasklist /v /fi "PID eq 21320" | find /i "21320" cmd.exe 21320 Console 1 3,184 K Run ning ****\****\ 0:00:00 ***: C:\windows\system32\cmd.exe C:\Users\***>echo %errorlevel% 0 === Check if process id 21322 exists, should return 1 == C:\Users\***>tasklist /v /fi "PID eq 21320" | find /i "21322" C:\Users\***>echo %errorlevel% 1 > Supervisor should restart worker immediately, if the worker process does not > exist any more > -------------------------------------------------------------------------------------------- > > Key: STORM-532 > URL: https://issues.apache.org/jira/browse/STORM-532 > Project: Apache Storm > Issue Type: Improvement > Affects Versions: 0.10.0 > Reporter: caofangkun > Priority: Minor > > For now > if the worker process does not exist any more > Supervisor will have to wait a few seconds for worker heartbeart timeout and > restart worker . > If supervisor knows the worker processid and check if the process exists in > the sync-processes thread ,may need less time to restart worker. > 1: record worker process id in the worker local heartbeart > 2: in supervisor sync-processes ,get process id from worker local heartbeat > and check if the process exits > 3: if not restart it immediately -- This message was sent by Atlassian JIRA (v6.3.4#6332)