Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lifecycle primary state error transitions #283

Open
wants to merge 4 commits into
base: gh-pages
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 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
11 changes: 9 additions & 2 deletions articles/node_lifecycle.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ There are 4 primary states:
- `Active`
- `Finalized`

To transition out of a primary state requires action from an external supervisory process, with the exception of an error being triggered in the `Active` state.
To transition out of a primary state requires action from an external supervisory process, with the exception of an error being triggered in the `Active` state or the `Inactive` state.
fujitatomoya marked this conversation as resolved.
Show resolved Hide resolved

There are also 6 transition states which are intermediate states during a requested transition.

Expand Down Expand Up @@ -71,6 +71,8 @@ This is the life cycle state the node is in immediately after being instantiated
This is also the state in which a node may be retuned to after an error has happened.
In this state there is expected to be no stored state.

If an error that cannot be handled by the node/system occurs in this state, the node will transition to `ErrorProcessing`.

#### Valid transition out

- The node may transition to the `Inactive` state via the `configure` transition.
Expand All @@ -89,6 +91,8 @@ Data retention will be subject to the configured QoS policy for the topic.

Any managed service requests to a node in the inactive state will not be answered (to the caller, they will fail immediately).

If an error that cannot be handled by the node/system occurs in this state, the node will transition to `ErrorProcessing`.

#### Valid transitions out of Inactive

- A node may transition to the `Finalized` state via the `shutdown` transition.
Expand Down Expand Up @@ -144,6 +148,7 @@ If the cleanup cannot be successfully achieved it will transition to `ErrorProce
#### Valid transitions out if CleaningUp

- If the `onCleanup` callback succeeds the node will transition to `Unconfigured`.
- If the `onCleanup` callback results in a failure code, the node will transition back to `Inactive`.
- If the `onCleanup` callback raises or results in any other return code the node will transition to `ErrorProcessing`.

### Transition State: Activating
Expand All @@ -156,6 +161,7 @@ Ideally, no preparation that requires significant time (such as lengthy hardware
#### Valid transitions out if Activating

- If the `onActivate` callback succeeds the node will transition to `Active`.
- If the `onActivate` callback results in a failure code, the node will transition back to `Inactive`.
- If the `onActivate` callback raises or results in any other return code the node will transition to `ErrorProcessing`.

### Transition State: Deactivating
Expand All @@ -166,6 +172,7 @@ This method is expected to do any cleanup to start executing, and should reverse
#### Valid transitions out of Deactivating

- If the `onDeactivate` callback succeeds the node will transition to `Inactive`.
- If the `onDeactivate` callback results in a failure code, the node will transition back to `Active`.
- If the `onDeactivate` callback raises or results in any other return code the node will transition to `ErrorProcessing`.

### Transition State: ShuttingDown
Expand All @@ -176,7 +183,7 @@ It may be entered from any Primary State except `Finalized`, the originating sta

#### Valid transitions out of ShuttingDown

- If the `onShutdown` callback succeeds the node will transition to `Finalized`.
- If the `onShutdown` callback succeeds or results in a failure code, the node will transition to `Finalized`.
fujitatomoya marked this conversation as resolved.
Show resolved Hide resolved
- If the `onShutdown` callback raises or results in any other return code the node will transition to `ErrorProcessing`.

### Transition State: ErrorProcessing
Expand Down
Binary file modified img/node_lifecycle/life_cycle_sm.asta
Binary file not shown.
Binary file modified img/node_lifecycle/life_cycle_sm.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.