Merge pull request #1640 from coreos-inc/fix-buildman

Fix cross-manager handling of realm components
This commit is contained in:
josephschorr 2016-07-21 15:53:21 -04:00 committed by GitHub
commit 040977a35f

View file

@ -196,11 +196,15 @@ class EphemeralBuilderManager(BaseManager):
build_job = BuildJob(AttrDict(realm_spec['job_queue_item']))
build_uuid = build_job.build_uuid
logger.debug('Realm key expired for build %s', build_uuid)
build_info = self._build_uuid_to_info.pop(build_uuid, None)
if build_info is not None:
# Pop the component off. If we find one, then the build has not connected to this manager,
# so we can safely unregister its component.
component = self._component_to_job.pop(build_info.component, None)
if component is not None:
# We were not the manager which the worker connected to, remove the bookkeeping for it
logger.debug('Unregistering unused component for build %s', build_uuid)
self._component_to_job.pop(build_info.component, None)
self.unregister_component(build_info.component)
else: