Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ Fixed
* Update ``st2-pack-install`` and ``st2 pack install`` command so it works with local git repos
(``file://<path to local git repo>``) which are in a detached head state (e.g. specific revision
is checked out). (improvement) #4366
* Fix a race which occurs when there are multiple concurrent requests to resume a workflow. #4369

2.9.0 - September 16, 2018
--------------------------
Expand Down
8 changes: 6 additions & 2 deletions st2common/st2common/services/workflows.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,15 +304,19 @@ def request_resume(ac_ex_db):
raise wf_exc.WorkflowExecutionIsCompletedException(str(wf_ex_db.id))

if wf_ex_db.status in states.RUNNING_STATES:
raise wf_exc.WorkflowExecutionIsRunningException(str(wf_ex_db.id))
msg = '[%s] Workflow execution "%s" is not resumed because it is already active.'
LOG.info(msg, wf_ac_ex_id, str(wf_ex_db.id))
return

conductor = deserialize_conductor(wf_ex_db)

if conductor.get_workflow_state() in states.COMPLETED_STATES:
raise wf_exc.WorkflowExecutionIsCompletedException(str(wf_ex_db.id))

if conductor.get_workflow_state() in states.RUNNING_STATES:
raise wf_exc.WorkflowExecutionIsRunningException(str(wf_ex_db.id))
msg = '[%s] Workflow execution "%s" is not resumed because it is already active.'
LOG.info(msg, wf_ac_ex_id, str(wf_ex_db.id))
return

conductor.request_workflow_state(states.RESUMING)

Expand Down
3 changes: 2 additions & 1 deletion st2tests/integration/orquesta/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,8 @@ def _wait_for_state(self, ex, states):
if ex.status in action_constants.LIVEACTION_COMPLETED_STATES:
raise Exception(
'Execution is in completed state "%s" and '
'does not match expected state(s).' % ex.status
'does not match expected state(s). %s' %
(ex.status, ex.result)
)
else:
raise
Expand Down