Skip to content
Snippets Groups Projects
Commit 88d48817 authored by Nathan Hertz's avatar Nathan Hertz
Browse files

Set queue state before asking for queue_report; reset queue state to

`NotQueued` on a failure
parent a19b8b9d
No related branches found
No related tags found
1 merge request!570WS-717: Attempting to fix queueing
Pipeline #3240 passed
......@@ -74,15 +74,17 @@ class ExecutionManager(ExecutionManagerIF):
# if this is PrepareAndRunWorkflow, we enter the queue by going into the Waiting state instead
if execution.current_step.step_type == CapabilityStepType.PrepareAndRunWorkflow:
logger.info("Sticking PrepareAndRunWorkflow into the queue")
self.queue_manager.execution_requested()
execution.queue_state = QueueState.Queued.name
self.capability_info.save_execution(execution)
transaction.commit()
self.queue_manager.execution_requested()
else:
logger.info("Proceding with execution")
# otherwise, we proceed with execution
self.execute(execution)
execution.queue_state = QueueState.Running.name
self.capability_info.save_execution(execution)
transaction.commit()
self.capability_info.save_execution(execution)
transaction.commit()
self.execute(execution)
return execution
def execute(self, execution: CapabilityExecutionIF):
......@@ -137,6 +139,7 @@ class ExecutionManager(ExecutionManagerIF):
if execution:
# TODO: Delete in favor of wholesale State message processing
execution.state = ExecutionState.Failed.name
execution.queue_state = QueueState.NotQueued.name
execution_failed_msg = CapabilityMessageArchitect(execution=execution).compose_message("execution_failed")
self.messenger.send_message(**execution_failed_msg)
......@@ -168,6 +171,7 @@ class ExecutionManager(ExecutionManagerIF):
execution = self.capability_info.lookup_execution_by_workflow_request_id(subject["current_workflow_request_id"])
# Record failure in databse
execution.state = ExecutionState.Failed.name
execution.queue_state = QueueState.NotQueued.name
self.capability_info.save_execution(execution)
def submit_workflow_request(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment