summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames E. Blair <jeblair@redhat.com>2018-11-30 13:28:25 -0800
committerJames E. Blair <jeblair@redhat.com>2018-11-30 13:47:57 -0800
commita0e4ff87f7bece0c81a5260a4e1fdefe9d711a18 (patch)
tree178723a41cb03a799240680d2d8cf8f108c32af7
parentc2d410d9feae8205ab5977635d036cfdbfcc9cf4 (diff)
Log exceptions in cache listener events
Notes
Notes (review): Code-Review+2: Clark Boylan <cboylan@sapwetik.org> Workflow+1: Clark Boylan <cboylan@sapwetik.org> Verified+2: Zuul Submitted-by: Zuul Submitted-at: Fri, 30 Nov 2018 22:17:38 +0000 Reviewed-on: https://review.openstack.org/621292 Project: openstack-infra/nodepool Branch: refs/heads/master
-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