Skip to content

Add CHASM lifecycle paused state#10046

Open
awln-temporal wants to merge 2 commits intomainfrom
chasm-lifecycle-paused-state
Open

Add CHASM lifecycle paused state#10046
awln-temporal wants to merge 2 commits intomainfrom
chasm-lifecycle-paused-state

Conversation

@awln-temporal
Copy link
Copy Markdown
Contributor

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?

  • built
  • run locally and tested manually
  • covered by existing tests
  • added new unit test(s)
  • added new functional test(s)

@awln-temporal awln-temporal requested a review from a team as a code owner April 23, 2026 23:22
Comment thread chasm/tree.go

// 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)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@yycptt yycptt requested a review from rodrigozhou April 28, 2026 01:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants