Don't start the scheduler when validating tenants
The start method starts extra threads like the apscheduler for sending stats, etc. We don't want any of that running when we are just validating tenants, so move the KeyStorage into the initializer and avoid running start/stop when we are validating tenants. (Tracebacks from periodic stats jobs were observed in long test runs.) Change-Id: I1aebdc3b5e069ab8bf8044de9d1121ae8d9798d7
This commit is contained in:
parent
8fbe8f7dfe
commit
c4a590df59
@ -2009,8 +2009,8 @@ class SchedulerTestApp:
|
||||
]
|
||||
|
||||
def start(self, validate_tenants=None):
|
||||
self.sched.start()
|
||||
if validate_tenants is None:
|
||||
self.sched.start()
|
||||
self.sched.prime(self.config)
|
||||
else:
|
||||
self.sched.validateTenants(self.config, validate_tenants)
|
||||
@ -2815,8 +2815,11 @@ class ZuulTestCase(BaseTestCase):
|
||||
self.executor_server.join()
|
||||
self.launcher.stop()
|
||||
self.launcher.join()
|
||||
self.scheds.execute(lambda app: app.sched.stop())
|
||||
self.scheds.execute(lambda app: app.sched.join())
|
||||
if self.validate_tenants is None:
|
||||
self.scheds.execute(lambda app: app.sched.stop())
|
||||
self.scheds.execute(lambda app: app.sched.join())
|
||||
else:
|
||||
self.scheds.execute(lambda app: app.sched.stopConnections())
|
||||
self.statsd.stop()
|
||||
self.statsd.join()
|
||||
self.fake_nodepool.stop()
|
||||
|
@ -32,8 +32,11 @@ class TestUpgradeOld(ZuulTestCase):
|
||||
|
||||
def shutdown(self):
|
||||
# Shutdown the scheduler now before it gets any aborted events
|
||||
self.scheds.execute(lambda app: app.sched.stop())
|
||||
self.scheds.execute(lambda app: app.sched.join())
|
||||
if self.validate_tenants is None:
|
||||
self.scheds.execute(lambda app: app.sched.stop())
|
||||
self.scheds.execute(lambda app: app.sched.join())
|
||||
else:
|
||||
self.scheds.execute(lambda app: app.sched.stopConnections())
|
||||
# Then release the executor jobs and stop the executors
|
||||
self.executor_server.hold_jobs_in_build = False
|
||||
self.executor_server.release()
|
||||
|
@ -118,6 +118,7 @@ class Scheduler(zuul.cmd.ZuulDaemonApp):
|
||||
|
||||
if self.args.validate_tenants is not None:
|
||||
self.sched.stop()
|
||||
self.sched.stopConnections()
|
||||
sys.exit(0)
|
||||
|
||||
if self.args.nodaemon:
|
||||
|
@ -332,6 +332,10 @@ class Scheduler(threading.Thread):
|
||||
self.connection_cleanup_lock = ConnectionCleanupLock(self.zk_client)
|
||||
self.node_request_cleanup_lock = NodeRequestCleanupLock(self.zk_client)
|
||||
|
||||
self.keystore = KeyStorage(
|
||||
self.zk_client,
|
||||
password=self._get_key_store_password())
|
||||
|
||||
self.abide = Abide()
|
||||
self.unparsed_abide = UnparsedAbideConfig()
|
||||
self.tenant_layout_state = LayoutStateStore(
|
||||
@ -365,9 +369,6 @@ class Scheduler(threading.Thread):
|
||||
|
||||
def start(self):
|
||||
super(Scheduler, self).start()
|
||||
self.keystore = KeyStorage(
|
||||
self.zk_client,
|
||||
password=self._get_key_store_password())
|
||||
|
||||
self._command_running = True
|
||||
self.log.debug("Starting command processor")
|
||||
|
Loading…
Reference in New Issue
Block a user