Add a comment about why we are taking a lock when terminating a builder machine.
This commit is contained in:
parent
f767fc4d03
commit
c435f5c127
1 changed files with 2 additions and 0 deletions
|
@ -105,6 +105,8 @@ class EphemeralBuilderManager(BaseManager):
|
|||
if 'builder_id' in job_metadata:
|
||||
builder_id = job_metadata['builder_id']
|
||||
|
||||
# Before we delete the build node, we take a lock to make sure that only one manager
|
||||
# can terminate the node.
|
||||
try:
|
||||
lock_key = self._etcd_lock_key(builder_id)
|
||||
yield From(self._etcd_client.write(lock_key, '', prevExist=False, ttl=self.setup_time()))
|
||||
|
|
Reference in a new issue