Skip to content

Commit 07bd0fd

Browse files
author
Michal Tichák
committed
[docs] add summary of virtual states into the operation_order.md
1 parent fd5d7a5 commit 07bd0fd

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

docs/handbook/operation_order.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,3 +102,21 @@ This is the order of actions happening at a healthy end of run.
102102
- `after_STOP_ACTIVITY` hooks with positive weights (incl. 0) are executed:
103103
- `ccdb.RunStop()` at `0`
104104
- `bookkeeping.UpdateRunStop()`, `bookkeeping.UpdateEnv()` at `+100`
105+
106+
## Virtual (manager-driven) states and transitions
107+
108+
State **PENDING** and transitions **TEARDOWN**, and **DESTROY** lie outside the core FSM in `environment.go` and are driven by the Manager. See [core/environment/manager.go](../../core/environment/manager.go) for details.
109+
As these are not in a FSM we trigger them be calling specific methods. You can find details about triggering these in the according sections.
110+
111+
### State PENDING
112+
113+
Before the FSM enters `STANDBY`, the Manager drives the initial creation steps by emitting `Ev_EnvironmentEvent` messages (`Transition: CREATE, State: PENDING`) for both `before_CREATE` (running hooks) and `CREATE` (loading workflow).
114+
115+
### Transition TEARDOWN
116+
117+
When the FSM is in `RUNNING` and `TeardownEnvironment` function is called, the Manager records both `run_end_time_ms` and `run_end_completion_time_ms` and emits message `Ev_RunEvent` with content (`Transition: TEARDOWN`, `OpStatus_STARTED`) for each of timestamps. Right now there is only `OpStatus_STARTED` reported in Kafka. You can trigger `TeardownEnvironment` for example by invoking gRPC method `DestroyEnvironment` with `Force = true`. You cannot trigger `TEARDOWN` by calling gRPC method `Teardown`.
118+
119+
### Transition DESTROY
120+
121+
The Manager’s `TeardownEnvironment(...)` drives a four‑step `Ev_EnvironmentEvent` sequence (`before_DESTROY`, `leave_<state>`, `DESTROY`, `after_DESTROY`) on `topic.Environment` to release tasks, run hooks, and finalize teardown.
122+
You can trigger `TeardownEnvironment` for example by invoking gRPC method `DestroyEnvironment` with `Force = true`.

0 commit comments

Comments
 (0)