Skip to content

Commit f81c766

Browse files
author
Gabriel Monroy
committed
fix(controller): add retry on destroy
1 parent 3eb39c0 commit f81c766

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

controller/scheduler/coreos.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,13 @@ def destroy(self, name):
189189
self._wait_for_destroy(name)
190190

191191
def _destroy_container(self, name):
192-
return self._delete_unit(name)
192+
for attempt in range(RETRIES):
193+
try:
194+
self._delete_unit(name)
195+
break
196+
except:
197+
if attempt == (RETRIES - 1): # account for 0 indexing
198+
raise
193199

194200
def run(self, name, image, entrypoint, command): # noqa
195201
"""Run a one-off command"""

0 commit comments

Comments
 (0)