Github user revans2 commented on a diff in the pull request: https://github.com/apache/storm/pull/1764#discussion_r90542812 --- Diff: storm-core/src/clj/org/apache/storm/daemon/nimbus.clj --- @@ -1008,23 +1008,24 @@ (reset! (:id->worker-resources nimbus) {})) ;; tasks figure out what tasks to talk to by looking at topology at runtime ;; only log/set when there's been a change to the assignment - (doseq [[topology-id assignment] new-assignments - :let [existing-assignment (get existing-assignments topology-id) - topology-details (.getById topologies topology-id)]] - (if (= existing-assignment assignment) - (log-debug "Assignment for " topology-id " hasn't changed") - (do - (log-message "Setting new assignment for topology id " topology-id ": " (pr-str assignment)) - (.setAssignment storm-cluster-state topology-id (thriftify-assignment assignment)) - ))) - (->> new-assignments - (map (fn [[topology-id assignment]] - (let [existing-assignment (get existing-assignments topology-id)] - [topology-id (map to-worker-slot (newly-added-slots existing-assignment assignment))] - ))) - (into {}) - (.assignSlots inimbus topologies))) - (log-message "not a leader, skipping assignments"))) + (locking (:sched-lock nimbus) --- End diff -- I agree and now that nimbus is in java we can look at doing some refactoring along those lines. If you feel that we need to do it now and that this is a blocker I can spend some time looking into how to do that better.
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---