Fix invalid workflow completion in case of "join"

When we use 'join' clause in workflow execution, the execution should be
in running status, until all possible upstream tasks are completed and
corresponding conditions have triggered.

Do not remove the tasks with unsatisfied join when continuing execution,
or the workflow will succeed erroneously. So, a new attribute
'wait_flag' is added to RunTask class, to indicate if the task should
run immediately.

The difference between 'waiting' and 'delayed' status is, 'waiting'
indicates a task needs to wait for its conditions to be satisfied,
'delayed' means the task has to wait because of policy(wait-before,
wait-after or retry).

Change-Id: Idcd162b9c000b85acf2adabc158f848d0824ac57
Closes-Bug: #1455038
This commit is contained in:
LingxianKong
2015-05-26 16:26:36 +08:00
parent 2811620769
commit 77cf6eb26a
8 changed files with 109 additions and 32 deletions

View File

@@ -71,3 +71,11 @@ class StatesModuleTest(base.BaseTest):
self.assertFalse(s.is_valid_transition(s.ERROR, s.DELAYED))
self.assertFalse(s.is_valid_transition(s.ERROR, s.SUCCESS))
self.assertFalse(s.is_valid_transition(s.ERROR, s.IDLE))
# From WAITING
self.assertTrue(s.is_valid_transition(s.WAITING, s.RUNNING))
self.assertFalse(s.is_valid_transition(s.WAITING, s.SUCCESS))
self.assertFalse(s.is_valid_transition(s.WAITING, s.PAUSED))
self.assertFalse(s.is_valid_transition(s.WAITING, s.DELAYED))
self.assertFalse(s.is_valid_transition(s.WAITING, s.IDLE))
self.assertFalse(s.is_valid_transition(s.WAITING, s.ERROR))