Commit 91e143eb authored by Daniele Venzano's avatar Daniele Venzano
Browse files

Cannot delete executions that are running since termination is asynchronous

parent 1852c8d1
......@@ -101,9 +101,7 @@ class APIEndpoint:
raise zoe_api.exceptions.ZoeAuthException()
if e.is_active():
status, message = self.execution_terminate(uid, role, exec_id)
if not status:
raise zoe_api.exceptions.ZoeException(message)
raise zoe_api.exceptions.ZoeException('Cannot delete an active execution')
status, message = self.master.execution_delete(exec_id)
if status:
......@@ -61,5 +61,6 @@ def restart_resubmit_scheduler(state: SQLManager, scheduler: ZoeScheduler):
def execution_delete(scheduler: ZoeScheduler, execution: Execution):
"""Remove an execution from the scheduler, must only be called if the execution is NOT running."""
assert not execution.is_active()
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