Commit de1117bb authored by Daniele Venzano's avatar Daniele Venzano

Automatic execution termination fixes

parent 0ef08483
...@@ -162,7 +162,7 @@ class APIEndpoint: ...@@ -162,7 +162,7 @@ class APIEndpoint:
for execution in all_execs: for execution in all_execs:
if execution.status == execution.RUNNING_STATUS: if execution.status == execution.RUNNING_STATUS:
for service in for service in
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:"Service {} of execution {} died, terminating execution".format(,"Service {} of execution {} died, terminating execution".format(,
self.master.execution_terminate( self.master.execution_terminate(
break break
...@@ -51,12 +51,13 @@ class ZoeSwarmChecker(threading.Thread): ...@@ -51,12 +51,13 @@ class ZoeSwarmChecker(threading.Thread):
for service in service_list: for service in service_list:
assert isinstance(service, Service) assert isinstance(service, Service)
if service.status != service.DOCKER_START_STATUS: if service.status != service.DOCKER_START_STATUS:
pass continue
found = False found = False
for container in container_list: for container in container_list:
if container['id'] == service.docker_id: if container['id'] == service.docker_id:
found = True found = True
if container['status'] == 'exited': if container['status'] == 'exited':'resetting status of service {}, died with no event'.format(
service.set_docker_status(service.DOCKER_DIE_STATUS) service.set_docker_status(service.DOCKER_DIE_STATUS)
if not found: if not found:
service.set_docker_status(service.DOCKER_DESTROY_STATUS) 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