Skip to content

Commit 54554c3

Browse files
author
Nathan Marz
committed
launch the worker heartbeat thread immediately so that slow loading tasks don't cause the worker to timeout
1 parent 103806c commit 54554c3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/clj/backtype/storm/daemon/worker.clj

+2-1
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,8 @@
226226
;; do this here so that the worker process dies if this fails
227227
;; it's important that worker heartbeat to supervisor ASAP when launching so that the supervisor knows it's running (and can move on)
228228
_ (heartbeat-fn)
229+
;; launch the heartbeat thread before tasks are loaded, so that slow-loading tasks don't cause the supervisor to kill the worker
230+
_ (schedule-recurring (:heartbeat-timer worker) 0 (conf WORKER-HEARTBEAT-FREQUENCY-SECS) heartbeat-fn)
229231

230232
refresh-connections (mk-refresh-connections worker)
231233

@@ -277,7 +279,6 @@
277279
)]
278280
(schedule-recurring (:refresh-connections-timer worker) 0 (conf TASK-REFRESH-POLL-SECS) refresh-connections)
279281
(schedule-recurring (:refresh-active-timer worker) 0 (conf TASK-REFRESH-POLL-SECS) (partial refresh-storm-active worker))
280-
(schedule-recurring (:heartbeat-timer worker) 0 (conf WORKER-HEARTBEAT-FREQUENCY-SECS) heartbeat-fn)
281282

282283
(log-message "Worker has topology config " (:storm-conf worker))
283284
(log-message "Worker " worker-id " for storm " storm-id " on " supervisor-id ":" port " has finished loading")

0 commit comments

Comments
 (0)