From c435f5c127497274aeadd97f2bbc824e85863b5d Mon Sep 17 00:00:00 2001 From: Jake Moshenko Date: Wed, 10 Jun 2015 15:44:26 -0400 Subject: [PATCH] Add a comment about why we are taking a lock when terminating a builder machine. --- buildman/manager/ephemeral.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/buildman/manager/ephemeral.py b/buildman/manager/ephemeral.py index 9a17b38fe..5f3ebb68c 100644 --- a/buildman/manager/ephemeral.py +++ b/buildman/manager/ephemeral.py @@ -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()))