Class FlowExecutionList
java.lang.Object
org.jenkinsci.plugins.workflow.flow.FlowExecutionList
- All Implemented Interfaces:
Iterable<FlowExecution>
Enumerates running builds and ensures they resume after Jenkins is restarted.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classstatic classWhen Jenkins starts up and everything is loaded, be sure to proactively resurrect all the ongoingFlowExecutions so that they start running again.static classWhenever a Pipeline resumes, resume all incomplete steps in itsFlowExecution.static classEnumeratesStepExecutions running insideFlowExecution.static interfaceAlternate mechanism for implementing the storage of the set of builds. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic FlowExecutionListget()booleanReturns true if all executions that were present in thisFlowExecutionListhave been loaded.iterator()Lists all the currentFlowExecutions.voidregister(FlowExecutionOwner self) It is the responsibility of theFlowExecutionOwnerto register itself before it starts executing.static voidsaveAll()voidunregister(FlowExecutionOwner self) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
EXECUTIONS_SUSPENDED
Milestone forTerminatorbetweenTermMilestone.STARTEDandLIST_SAVED. All running builds have been suspended and theirFlowExecutionOwner.getListener()s closed.- See Also:
-
LIST_SAVED
Milestone forTerminatorbetweenEXECUTIONS_SUSPENDEDandTermMilestone.COMPLETED.FlowExecutionListitself has been saved.- See Also:
-
-
Constructor Details
-
FlowExecutionList
public FlowExecutionList()
-
-
Method Details
-
iterator
Lists all the currentFlowExecutions.- Specified by:
iteratorin interfaceIterable<FlowExecution>
-
register
It is the responsibility of theFlowExecutionOwnerto register itself before it starts executing. And likewise, unregister itself after it is completed, even though this class does clean up entries that are no longer running. -
unregister
-
get
-
isResumptionComplete
@Restricted(org.kohsuke.accmod.restrictions.Beta.class) public boolean isResumptionComplete()Returns true if all executions that were present in thisFlowExecutionListhave been loaded.This takes place slightly after
InitMilestone.COMPLETEDis reached during Jenkins startup.Useful to avoid resuming Pipelines in contexts that may lead to deadlock.
It is not guaranteed that
FlowExecution.afterStepExecutionsResumed()has been called at this point. -
saveAll
@Restricted(org.kohsuke.accmod.restrictions.DoNotUse.class) @Terminator(requires="FlowExecutionList.EXECUTIONS_SUSPENDED", attains="FlowExecutionList.LIST_SAVED") public static void saveAll() throws InterruptedException- Throws:
InterruptedException
-