summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Westphahl <simon.westphahl@bmw.de>2023-02-16 14:16:49 +0100
committerSimon Westphahl <simon.westphahl@bmw.de>2023-02-17 08:39:07 +0100
commitb23f76e67706cc29db96bdcb986020dbc980ce7d (patch)
tree2067d2e597abf49771fa0ccbe5dbf154cc6b7c5b
parentc90e91cd69785b91d7cc0622e43301936ecea4c7 (diff)
downloadzuul-b23f76e67706cc29db96bdcb986020dbc980ce7d.tar.gz
Update reconfig event ltime on (smart) reconfig
Make sure to update the last reconfig event ltime in the layout state during a (smart) reconfig. This is important in order to unblock pipelines when a tenant reconfig event is lost. So far the last reconfig event ltime was passed as -1, but wasn't set in the layout state since the ltime is not allowed to go backward. Change-Id: Iab04a962abbfbe901c22e4d5f1d484e3f53b0d33
-rw-r--r--tests/unit/test_scheduler.py4
-rw-r--r--zuul/scheduler.py2
2 files changed, 5 insertions, 1 deletions
diff --git a/tests/unit/test_scheduler.py b/tests/unit/test_scheduler.py
index 1a5657ed6..172ed34dc 100644
--- a/tests/unit/test_scheduler.py
+++ b/tests/unit/test_scheduler.py
@@ -3960,6 +3960,10 @@ class TestScheduler(ZuulTestCase):
else:
time.sleep(0)
+ self.assertGreater(new.last_reconfigured, old.last_reconfigured)
+ self.assertGreater(new.last_reconfigure_event_ltime,
+ old.last_reconfigure_event_ltime)
+
def test_tenant_reconfiguration_command_socket(self):
"Test that single-tenant reconfiguration via command socket works"
diff --git a/zuul/scheduler.py b/zuul/scheduler.py
index b8314f162..e646c09b8 100644
--- a/zuul/scheduler.py
+++ b/zuul/scheduler.py
@@ -1528,7 +1528,7 @@ class Scheduler(threading.Thread):
with self.createZKContext(lock, self.log) as ctx:
if tenant is not None:
self._reconfigureTenant(ctx, min_ltimes,
- -1,
+ event.zuul_event_ltime,
tenant, old_tenant)
else:
self._reconfigureDeleteTenant(ctx, old_tenant)