summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZuul <zuul@review.openstack.org>2018-11-30 22:17:38 +0000
committerGerrit Code Review <review@openstack.org>2018-11-30 22:17:38 +0000
commit85968314bd472c13695d5d178d4b8a2db968c6e6 (patch)
treeb1b6e36a2ea3e119e5843d809f1c21850c2850b1
parentf8d20d603cad9afdd85d9cfc82c559b32167d30f (diff)
parenta0e4ff87f7bece0c81a5260a4e1fdefe9d711a18 (diff)
Merge "Log exceptions in cache listener events"
-rwxr-xr-xnodepool/zk.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/nodepool/zk.py b/nodepool/zk.py
index 5a65b2e..4347b41 100755
--- a/nodepool/zk.py
+++ b/nodepool/zk.py
@@ -2086,7 +2086,13 @@ class ZooKeeper(object):
2086 self.log.exception(e) 2086 self.log.exception(e)
2087 2087
2088 def nodeCacheListener(self, event): 2088 def nodeCacheListener(self, event):
2089 try:
2090 self._nodeCacheListener(event)
2091 except Exception:
2092 self.log.exception("Exception in node cache update for event: %s",
2093 event)
2089 2094
2095 def _nodeCacheListener(self, event):
2090 if hasattr(event.event_data, 'path'): 2096 if hasattr(event.event_data, 'path'):
2091 # Ignore root node 2097 # Ignore root node
2092 path = event.event_data.path 2098 path = event.event_data.path
@@ -2142,7 +2148,14 @@ class ZooKeeper(object):
2142 self.node_stats_event = event 2148 self.node_stats_event = event
2143 2149
2144 def requestCacheListener(self, event): 2150 def requestCacheListener(self, event):
2151 try:
2152 self._requestCacheListener(event)
2153 except Exception:
2154 self.log.exception(
2155 "Exception in request cache update for event: %s",
2156 event)
2145 2157
2158 def _requestCacheListener(self, event):
2146 if hasattr(event.event_data, 'path'): 2159 if hasattr(event.event_data, 'path'):
2147 # Ignore root node 2160 # Ignore root node
2148 path = event.event_data.path 2161 path = event.event_data.path