Protect against builds dict changing while we iterate
As we check for lost builds, the builds dict can change which throws
an exception.
Change-Id: I63d042d6b64fe8fb1a755da067df420d52c9eea5
diff --git a/zuul/executor/client.py b/zuul/executor/client.py
index 0e6544b..2ca69fc 100644
--- a/zuul/executor/client.py
+++ b/zuul/executor/client.py
@@ -445,7 +445,9 @@
def lookForLostBuilds(self):
self.log.debug("Looking for lost builds")
- for build in self.builds.values():
+ # Construct a list from the values iterator to protect from it changing
+ # out from underneath us.
+ for build in list(self.builds.values()):
if build.result:
# The build has finished, it will be removed
continue