Skip to content

Commit 25fcbf9

Browse files
author
Nathan Marz
committed
more informative logging in supervisor
1 parent 4f8de00 commit 25fcbf9

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/clj/backtype/storm/daemon/supervisor.clj

+4-3
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,9 @@
8989

9090
(defn read-allocated-workers
9191
"Returns map from worker id to worker heartbeat. if the heartbeat is nil, then the worker is dead (timed out or never wrote heartbeat)"
92-
[supervisor assigned-tasks]
92+
[supervisor assigned-tasks now]
9393
(let [conf (:conf supervisor)
9494
^LocalState local-state (:local-state supervisor)
95-
now (current-time-secs)
9695
id->heartbeat (read-worker-heartbeats conf)
9796
approved-ids (set (keys (.get local-state LS-APPROVED-WORKERS)))]
9897
(into
@@ -189,7 +188,8 @@
189188
^LocalState local-state (:local-state supervisor)
190189
assigned-tasks (defaulted (.get local-state LS-LOCAL-ASSIGNMENTS)
191190
{})
192-
allocated (read-allocated-workers supervisor assigned-tasks)
191+
now (current-time-secs)
192+
allocated (read-allocated-workers supervisor assigned-tasks now)
193193
keepers (filter-val
194194
(fn [[state _]] (= state :valid))
195195
allocated)
@@ -217,6 +217,7 @@
217217
(when (not= :valid state)
218218
(log-message
219219
"Shutting down and clearing state for id " id
220+
". Current supervisor time: " now
220221
". State: " state
221222
", Heartbeat: " (pr-str heartbeat))
222223
(shutdown-worker supervisor id)

0 commit comments

Comments
 (0)