"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "buildbot/master.py" between
buildbot-3.0.2.tar.gz and buildbot-3.1.0.tar.gz

About: Buildbot is a continuous integration testing framework (Python-based). It supports also automation of complex build systems, application deployment, and management of sophisticated software-release processes.

master.py  (buildbot-3.0.2):master.py  (buildbot-3.1.0)
skipping to change at line 365 skipping to change at line 365
# this method wraps doConfig, ensuring it is only ever called once at # this method wraps doConfig, ensuring it is only ever called once at
# a time, and alerting the user if the reconfig takes too long # a time, and alerting the user if the reconfig takes too long
if self.reconfig_active: if self.reconfig_active:
log.msg("reconfig already active; will reconfig again after") log.msg("reconfig already active; will reconfig again after")
self.reconfig_requested = True self.reconfig_requested = True
return return
self.reconfig_active = self.reactor.seconds() self.reconfig_active = self.reactor.seconds()
metrics.MetricCountEvent.log("loaded_config", 1) metrics.MetricCountEvent.log("loaded_config", 1)
# notify every 10 seconds that the reconfig is still going on, although # notify every 10 seconds that the reconfig is still going on, the durat
# reconfigs should not take that long! ion of reconfigs is
# longer on larger installations and may take a while.
self.reconfig_notifier = task.LoopingCall( self.reconfig_notifier = task.LoopingCall(
lambda: log.msg("reconfig is ongoing for {} s".format(self.reactor.s lambda: log.msg("reconfig is ongoing for {:.3f} s".format(self.react
econds() - or.seconds() -
self.reconfig_ self.recon
active))) fig_active)))
self.reconfig_notifier.start(10, now=False) self.reconfig_notifier.start(10, now=False)
timer = metrics.Timer("BuildMaster.reconfig") timer = metrics.Timer("BuildMaster.reconfig")
timer.start() timer.start()
try: try:
yield self.doReconfig() yield self.doReconfig()
except Exception as e: except Exception as e:
log.err(e, 'while reconfiguring') log.err(e, 'while reconfiguring')
finally: finally:
skipping to change at line 391 skipping to change at line 391
self.reconfig_notifier.stop() self.reconfig_notifier.stop()
self.reconfig_notifier = None self.reconfig_notifier = None
self.reconfig_active = False self.reconfig_active = False
if self.reconfig_requested: if self.reconfig_requested:
self.reconfig_requested = False self.reconfig_requested = False
self.reconfig() self.reconfig()
@defer.inlineCallbacks @defer.inlineCallbacks
def doReconfig(self): def doReconfig(self):
log.msg("beginning configuration update") log.msg("beginning configuration update")
time_started = self.reactor.seconds()
changes_made = False changes_made = False
failed = False failed = False
try: try:
yield self.initLock.acquire() yield self.initLock.acquire()
# Run the master.cfg in thread, so that it can use blocking code # Run the master.cfg in thread, so that it can use blocking code
new_config = yield threads.deferToThreadPool( new_config = yield threads.deferToThreadPool(
self.reactor, self.reactor.getThreadPool(), self.reactor, self.reactor.getThreadPool(),
self.config_loader.loadConfig) self.config_loader.loadConfig)
changes_made = True changes_made = True
self.config_version += 1 self.config_version += 1
skipping to change at line 419 skipping to change at line 420
except Exception: except Exception:
log.err(failure.Failure(), 'during reconfig:') log.err(failure.Failure(), 'during reconfig:')
failed = True failed = True
finally: finally:
yield self.initLock.release() yield self.initLock.release()
if failed: if failed:
if changes_made: if changes_made:
log.msg("WARNING: reconfig partially applied; master " msg = "WARNING: configuration update partially applied; master m
"may malfunction") ay malfunction"
else: else:
log.msg("reconfig aborted without making any changes") msg = "configuration update aborted without making any changes"
else: else:
log.msg("configuration update complete") msg = "configuration update complete"
log.msg("{} (took {:.3f} seconds)".format(msg, self.reactor.seconds() -
time_started))
def reconfigServiceWithBuildbotConfig(self, new_config): def reconfigServiceWithBuildbotConfig(self, new_config):
if self.configured_db_url is None: if self.configured_db_url is None:
self.configured_db_url = new_config.db['db_url'] self.configured_db_url = new_config.db['db_url']
elif (self.configured_db_url != new_config.db['db_url']): elif (self.configured_db_url != new_config.db['db_url']):
config.error( config.error(
"Cannot change c['db']['db_url'] after the master has started", "Cannot change c['db']['db_url'] after the master has started",
) )
if self.config.mq['type'] != new_config.mq['type']: if self.config.mq['type'] != new_config.mq['type']:
 End of changes. 6 change blocks. 
10 lines changed or deleted 15 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)