Browse Source

Merge "Log exceptions in cache listener events"

Zuul 4 months ago
parent
commit
85968314bd
1 changed files with 13 additions and 0 deletions
  1. 13
    0
      nodepool/zk.py

+ 13
- 0
nodepool/zk.py View File

@@ -2086,7 +2086,13 @@ class ZooKeeper(object):
2086 2086
         self.log.exception(e)
2087 2087
 
2088 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 2096
         if hasattr(event.event_data, 'path'):
2091 2097
             # Ignore root node
2092 2098
             path = event.event_data.path
@@ -2142,7 +2148,14 @@ class ZooKeeper(object):
2142 2148
         self.node_stats_event = event
2143 2149
 
2144 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 2159
         if hasattr(event.event_data, 'path'):
2147 2160
             # Ignore root node
2148 2161
             path = event.event_data.path

Loading…
Cancel
Save