Add a comment about why we are taking a lock when terminating a builder machine.

This commit is contained in:
Jake Moshenko 2015-06-10 15:44:26 -04:00
parent f767fc4d03
commit c435f5c127

View file

@ -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()))