summaryrefslogtreecommitdiff
path: root/zuul/zk/event_queues.py
diff options
context:
space:
mode:
authorJames E. Blair <jim@acmegating.com>2021-12-14 10:52:36 -0800
committerJames E. Blair <jim@acmegating.com>2021-12-14 11:00:40 -0800
commita2714c370a05d80f1d947c6344eda89a4902ec42 (patch)
treef05206f6979ffe272e05476e25bb0dddeb75a216 /zuul/zk/event_queues.py
parent9a2fd432f1ee87c8b9cb9fbb89e15590c544b844 (diff)
downloadzuul-a2714c370a05d80f1d947c6344eda89a4902ec42.tar.gz
Fix merging reconfiguration events
Reconfiguration events for the same tenant are supposed to be merged so that if many branches are created, only one reconfiguration happens. However, an error existed in the merge method which raised an exception preventing the merge, and the exception handler around the merge method was too broad and therefore suppressed the error. This is well tested, but with tests that look more like "unit" tests rather than functional tests. They did not contain the branch_cache_ltime dict which triggered the error. This patch corrects the error and updates the test to be more realistic. Change-Id: I0b5c7628a0580db55b56eec8c081ebee4d31d989
Diffstat (limited to 'zuul/zk/event_queues.py')
-rw-r--r--zuul/zk/event_queues.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/zuul/zk/event_queues.py b/zuul/zk/event_queues.py
index 3f8453e73..23e9be31f 100644
--- a/zuul/zk/event_queues.py
+++ b/zuul/zk/event_queues.py
@@ -560,8 +560,11 @@ class ManagementEventQueue(ZooKeeperEventQueue):
if event.zuul_event_ltime is None:
event.zuul_event_ltime = zstat.creation_transaction_id
- with suppress(ValueError):
+ try:
other_event = event_list[event_list.index(event)]
+ except ValueError:
+ other_event = None
+ if other_event:
if isinstance(other_event, model.TenantReconfigureEvent):
other_event.merge(event)
continue