Jump to: navigation, search

Difference between revisions of "TaskFlow/States of Task and Flow"

(Appendix A: Diagrams)
(Replaced content with "'''Revised on:''' {{REVISIONMONTH1}}/{{REVISIONDAY}}/{{REVISIONYEAR}} by {{REVISIONUSER}} __TOC__ The page was moved to developers documentation: http://docs.openstack.o...")
 
(47 intermediate revisions by 3 users not shown)
Line 1: Line 1:
== Task States ==
+
'''Revised on:''' {{REVISIONMONTH1}}/{{REVISIONDAY}}/{{REVISIONYEAR}} by {{REVISIONUSER}}
  
When task just added to the flow, it is in '''PENDING''' state, which means it can be executed or waits for all of task it depends on to complete. Then, when task is executed, it transitions to '''RUNNING''' state, and stays in it until its <code>execute()</code> method returns. When task is finished, it transitions to '''SUCCESS''' state if it was finished successfully, or to '''FAILURE''' state if not.
+
__TOC__
 
+
The page was moved to developers documentation: http://docs.openstack.org/developer/taskflow/states.html
When flow is reverted, all tasks in '''PENDING''' state are left as is; tasks from all the other states transition to '''REVERTING''' state, and their <code>revert()</code> method is called. When that method returns, task transitions to '''REVERTED''' state, and then to '''PENDING'''.
 
 
 
Transition from '''RUNNING''' to '''REVERTING''' state happens when task was interrupted while running, and then revert occurs. This may take place e.g. when daemon is killed while running the task.
 
 
 
Transition from '''REVERTED''' to '''PENDING''' state happens immediately. The main purpose of '''REVERTED''' state is notifications.
 
 
 
'''Discuss''': it may be worth to perform transition from '''REVERTED''' to '''PENDING''' automatically when resuming flow from storage.
 
 
 
== Flow States ==
 
 
 
 
 
'''TODO(imelnikov)''' There are more flow states defined then present on the diagram: it does not include '''RESUMING''', '''CANCELED''', '''INCOMPLETE'''. Still need to figure out their precise semantics.
 
 
 
 
 
 
 
== Appendix A: Diagrams ==
 
 
 
<gallery mode="traditional">
 
File:Tf task state diagram.png|''Task state diagram''
 
File:Tf flow state diagram.png|''Flow state diagram''
 
</gallery>
 
 
 
 
 
=== Generating ===
 
 
 
The diagrams were drawn using [[http://plantuml.sourceforge.net/ PlantUML]]. You can re-create them offline or online [[http://www.plantuml.com/plantuml/form here]].
 
 
 
Source for task state diagram:
 
  [*] --> PENDING
 
  PENDING --> RUNNING
 
  RUNNING --> SUCCESS
 
  RUNNING --> FAILURE
 
  RUNNING --> REVERTING
 
  SUCCESS --> REVERTING
 
  FAILURE --> REVERTING
 
  REVERTING -up-> REVERTED
 
  REVERTING -up-> FAILURE
 
  REVERTED -up-> PENDING
 
 
 
Source for flow state diagram:
 
  [*] --> PENDING
 
  PENDING --> RUNNING
 
  RUNNING --> SUCCESS
 
  RUNNING --> REVERTING : failure
 
  RUNNING --> INTERRUPTED
 
  REVERTING --> INTERRUPTED
 
  INTERRUPTED -l-> RUNNING
 
  INTERRUPTED --> REVERTING
 
  REVERTING --> REVERTED
 
  REVERTED --> FAILUR
 

Latest revision as of 13:54, 25 March 2014

Revised on: 3/25/2014 by Akarpinska


The page was moved to developers documentation: http://docs.openstack.org/developer/taskflow/states.html