Add CHASM lifecycle paused state#10046
Conversation
|
|
||
| // Paused components (and their non-detached sub-components) have all tasks invalidated. | ||
| // Component authors must re-emit tasks when transitioning back to running. | ||
| paused, err := n.isInPausedSubtree(validateContext) |
There was a problem hiding this comment.
hmm can we refactor the code a bit and check ancestor only once for both paused and access rule check? Both are based on ancestors' lifecycle state.
Not for this PR:
I think as a follow optimization for the close transaction code path, since we are already doing a prefix traversal of the tree, we know if a node is in the scope of a paused component or not and doesn't need to go back the ancestor nodes. I think this is doable by changing the andAllChildren iterator implementation to return more information.
There was a problem hiding this comment.
actually there's a problem for side effect tasks created before component is paused. When those tasks are executed, component may not be in paused state any more and can get executed.
so we need to check if the corresponding logical task still exists for the component or not.
What changed?
Add CHASM lifecycle paused state. Invalidates all pending logical tasks.
Why?
There are duplicate implementations in Libraries where authors have implemented their own statuses to act as a PAUSE state, preventing all tasks from executing.
How did you test it?