3.8.14. Masters connector

class buildbot.db.masters.MastersConnectorComponent

This class handles tracking the buildmasters in a multi-master configuration. Masters “check in” periodically. Other masters monitor the last activity times, and mark masters that have not recently checked in as inactive.

Masters are represented by master dictionaries with the following keys:

  • id – the ID of this master

  • name – the name of the master (generally of the form hostname:basedir)

  • active – true if this master is running

  • last_active – time that this master last checked in (a datetime object)


name (unicode) – name of this master


master id via Deferred

Return the master ID for the master with this master name (generally hostname:basedir). If such a master is already in the database, this returns the ID. If not, the master is added to the database, with active=False, and its ID returned.

setMasterState(masterid, active)
  • masterid (integer) – the master to check in

  • active (boolean) – whether to mark this master as active or inactive


boolean via Deferred

Mark the given master as active or inactive, returning true if the state actually changed. If active is true, the last_active time is updated to the current time. If active is false, then any links to this master, such as schedulers, will be deleted.


masterid (integer) – the master to check in


Master dict or None via Deferred

Get the indicated master.


list of Master dicts via Deferred

Get a list of the masters, represented as dictionaries; masters are sorted and paged using generic data query options


None via Deferred

This method is intended to be called by upgrade-master, and will effectively force housekeeping on all masters at next startup. This method is not intended to be called outside of housekeeping scripts.