From 2eaec092f05ed6a124a228f49a6b9846e1c6b566 Mon Sep 17 00:00:00 2001 From: Joseph Schorr Date: Wed, 25 Feb 2015 13:47:36 -0500 Subject: [PATCH] Handle the case where we cannot write the tags on the build nodes --- buildman/manager/executor.py | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/buildman/manager/executor.py b/buildman/manager/executor.py index 035d5cdf8..b548420f5 100644 --- a/buildman/manager/executor.py +++ b/buildman/manager/executor.py @@ -143,12 +143,18 @@ class EC2Executor(BuilderExecutor): raise ExecutorException('EC2 started wrong number of instances!') launched = AsyncWrapper(reservation.instances[0]) - yield From(launched.add_tags({ - 'Name': 'Quay Ephemeral Builder', - 'Realm': realm, - 'Token': token, - 'BuildUUID': build_uuid, - })) + + for i in range(0, 2): + try: + yield From(launched.add_tags({ + 'Name': 'Quay Ephemeral Builder', + 'Realm': realm, + 'Token': token, + 'BuildUUID': build_uuid, + })) + except boto.exception.EC2ResponseError: + logger.exception('Failed to write EC2 tags (attempt #%s)', i) + raise Return(launched.id) @coroutine