storm-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kabh...@apache.org
Subject [1/3] storm git commit: Revert bad change to pacemaker client.
Date Mon, 06 Mar 2017 12:37:13 GMT
Repository: storm
Updated Branches:
  refs/heads/1.0.x-branch b03e64af5 -> de879e0f4


Revert bad change to pacemaker client.


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

Branch: refs/heads/1.0.x-branch
Commit: 9b179bfd435525b29bf2eafc0fd22dbe2072fb9f
Parents: e91c03f
Author: Kyle Nusbaum <knusbaum@yahoo-inc.com>
Authored: Mon Feb 27 13:51:10 2017 -0600
Committer: Kyle Nusbaum <knusbaum@yahoo-inc.com>
Committed: Mon Feb 27 13:51:10 2017 -0600

----------------------------------------------------------------------
 .../storm/pacemaker/pacemaker_state_factory.clj | 21 ++++++++------------
 1 file changed, 8 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/storm/blob/9b179bfd/storm-core/src/clj/org/apache/storm/pacemaker/pacemaker_state_factory.clj
----------------------------------------------------------------------
diff --git a/storm-core/src/clj/org/apache/storm/pacemaker/pacemaker_state_factory.clj b/storm-core/src/clj/org/apache/storm/pacemaker/pacemaker_state_factory.clj
index 21f3ee1..5a92d33 100644
--- a/storm-core/src/clj/org/apache/storm/pacemaker/pacemaker_state_factory.clj
+++ b/storm-core/src/clj/org/apache/storm/pacemaker/pacemaker_state_factory.clj
@@ -86,19 +86,14 @@
       (delete_worker_hb [this path]
         (util/retry-on-exception
          max-retries
-         "delete-worker-hb"
-         #(let [pacemaker-client-pool (makeClientPool conf pacemaker-client-pool servers)
-                results (map (fn [[host client]]
-                               (try
-                                 (if (is-connection-ready client)
-                                   (delete-worker-hb path client)
-                                   :error)
-                                 (catch Exception e
-                                   :error)))
-                             @pacemaker-client-pool)]
-            (when (every? (fn [result] (= :error result)) results)
-              (throw (HBExecutionException. "Cannot connect to any pacemaker servers"))))
-         nil))
+         "delete_worker_hb"
+         #(let [response
+                (.send pacemaker-client
+                       (HBMessage. HBServerMessageType/DELETE_PATH
+                                   (HBMessageData/path path)))]
+            (if (= (.get_type response) HBServerMessageType/DELETE_PATH_RESPONSE)
+              :ok
+              (throw (HBExecutionException. "Invalid Response Type"))))))
 
       ;; aggregating worker heartbeat details
       (get_worker_hb [this path watch?]


Mime
View raw message