Github user revans2 commented on a diff in the pull request:

    https://github.com/apache/storm/pull/1764#discussion_r90538639
  
    --- 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 --
    
    @jerrypeng You are correct that this could happen.  I don't really think it 
will be that likely to happen in practice but I'll think about it and see if we 
can fix it.


---
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.
---

Reply via email to