Commit de1117bb authored by Daniele Venzano's avatar Daniele Venzano

Automatic execution termination fixes

parent 0ef08483
......@@ -162,7 +162,7 @@ class APIEndpoint:
for execution in all_execs:
if execution.status == execution.RUNNING_STATUS:
for service in execution.services:
if service.description['monitor'] and service.docker_status == service.DOCKER_DIE_STATUS:
if service.description['monitor'] and service.docker_status == service.DOCKER_DIE_STATUS or service.docker_status == service.DOCKER_DESTROY_STATUS:
log.info("Service {} of execution {} died, terminating execution".format(service.name, execution.id))
self.master.execution_terminate(execution.id)
break
......
......@@ -51,12 +51,13 @@ class ZoeSwarmChecker(threading.Thread):
for service in service_list:
assert isinstance(service, Service)
if service.status != service.DOCKER_START_STATUS:
pass
continue
found = False
for container in container_list:
if container['id'] == service.docker_id:
found = True
if container['status'] == 'exited':
log.info('resetting status of service {}, died with no event'.format(service.name))
service.set_docker_status(service.DOCKER_DIE_STATUS)
if not found:
service.set_docker_status(service.DOCKER_DESTROY_STATUS)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment