storm-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bo...@apache.org
Subject [1/3] storm git commit: Check if /backpressure/storm-id znode exists before requesting children
Date Fri, 04 Mar 2016 15:45:10 GMT
Repository: storm
Updated Branches:
  refs/heads/1.x-branch 66ce7cee9 -> 84e3444ec


Check if /backpressure/storm-id znode  exists before requesting children


Project: http://git-wip-us.apache.org/repos/asf/storm/repo
Commit: http://git-wip-us.apache.org/repos/asf/storm/commit/4fdb14a0
Tree: http://git-wip-us.apache.org/repos/asf/storm/tree/4fdb14a0
Diff: http://git-wip-us.apache.org/repos/asf/storm/diff/4fdb14a0

Branch: refs/heads/1.x-branch
Commit: 4fdb14a0b24ca52ad6a3f4616965e75613472452
Parents: 3a6e3e4
Author: Kishor Patil <kpatil@yahoo-inc.com>
Authored: Thu Mar 3 12:38:01 2016 -0600
Committer: Kishor Patil <kpatil@yahoo-inc.com>
Committed: Thu Mar 3 12:38:01 2016 -0600

----------------------------------------------------------------------
 storm-core/src/clj/org/apache/storm/cluster.clj | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/storm/blob/4fdb14a0/storm-core/src/clj/org/apache/storm/cluster.clj
----------------------------------------------------------------------
diff --git a/storm-core/src/clj/org/apache/storm/cluster.clj b/storm-core/src/clj/org/apache/storm/cluster.clj
index 9b01df9..5315f1a 100644
--- a/storm-core/src/clj/org/apache/storm/cluster.clj
+++ b/storm-core/src/clj/org/apache/storm/cluster.clj
@@ -486,11 +486,13 @@
     
       (topology-backpressure
         [this storm-id callback]
-        "if the backpresure/storm-id dir is not empty, this topology has throttle-on, otherwise
throttle-off."
+        "if the backpresure/storm-id dir is not empty, this topology has throttle-on, otherwise
throttle-off.
+         The backpressure/storm-id dir may not exist if nimbus has shutdown the topology"
         (when callback
           (swap! backpressure-callback assoc storm-id callback))
         (let [path (backpressure-storm-root storm-id)
-              children (.get_children cluster-state path (not-nil? callback))]
+              children (if (.node_exists cluster-state path false)
+                         (.get_children cluster-state path (not-nil? callback))) ]
               (> (count children) 0)))
       
       (setup-backpressure!


Mime
View raw message