Make pop on realm work even if the realm isn't present
This is cleanup code and, occasionally, we get a cleanup without the realm having been added, leading to a KeyError
This commit is contained in:
parent
2ef55a5842
commit
fd4a31d3c3
1 changed files with 7 additions and 3 deletions
|
@ -132,8 +132,12 @@ class BuilderServer(object):
|
||||||
logger.debug('Unregistering component with realm %s and token %s',
|
logger.debug('Unregistering component with realm %s and token %s',
|
||||||
component.builder_realm, component.expected_token)
|
component.builder_realm, component.expected_token)
|
||||||
|
|
||||||
self._realm_map.pop(component.builder_realm)
|
self._realm_map.pop(component.builder_realm, None)
|
||||||
|
|
||||||
|
if component in self._current_components:
|
||||||
self._current_components.remove(component)
|
self._current_components.remove(component)
|
||||||
|
|
||||||
|
if component in self._session_factory:
|
||||||
self._session_factory.remove(component)
|
self._session_factory.remove(component)
|
||||||
|
|
||||||
def _job_heartbeat(self, build_job):
|
def _job_heartbeat(self, build_job):
|
||||||
|
|
Reference in a new issue