Permalink
Browse files

make sure no transition case returns nil

  • Loading branch information...
1 parent 8aed7da commit c2b9a60e95e9d5b8005bfaec01c3e78d7b5bef52 @nathanmarz committed Dec 18, 2011
Showing with 7 additions and 1 deletion.
  1. +7 −1 src/clj/backtype/storm/daemon/nimbus.clj
@@ -95,6 +95,12 @@
nil
))
+;; there's a minor problem where rebalancing is scheduled over and over until it finally happens
+;; can fix this by either:
+;; 1. detecting whether it's scheduled or not...
+;; 2. not using monitor event, but rather some sort of "on startup" event
+;; 3. generating a "rebalance id" and only rebalancing if current status has that id
+
(defn state-transitions [nimbus storm-id status]
{:active {:monitor (reassign-transition nimbus storm-id)
:inactivate :inactive
@@ -150,7 +156,7 @@
" storm-id: " storm-id)]
(if error-on-no-transition?
(throw-runtime msg)
- (log-message msg)
+ (do (log-message msg) nil)
))))
transition (-> (state-transitions nimbus storm-id status)
(get (:type status))

0 comments on commit c2b9a60

Please sign in to comment.