Skip to content

DescribeWorkflow reads pending nexus operations from CHASM#9913

Open
S15 wants to merge 1 commit intotemporalio:mainfrom
S15:nexus-chasm-describeworkflow
Open

DescribeWorkflow reads pending nexus operations from CHASM#9913
S15 wants to merge 1 commit intotemporalio:mainfrom
S15:nexus-chasm-describeworkflow

Conversation

@S15
Copy link
Copy Markdown
Contributor

@S15 S15 commented Apr 10, 2026

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)

@S15 S15 marked this pull request as ready for review April 10, 2026 19:56
@S15 S15 requested review from a team as code owners April 10, 2026 19:56
@S15 S15 requested review from bergundy and stephanos April 10, 2026 19:56
o.Status = status
}

func cancellationAPIState(status nexusoperationpb.CancellationStatus) enumspb.NexusOperationCancellationState {
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.

This should be implemented in @stephanos's standalone nexus branch. Add a TODO to remove the duplication please.

Comment on lines +67 to +68
// ToCancellationInfo converts a CHASM Cancellation to the API NexusOperationCancellationInfo format.
func (o *Cancellation) ToCancellationInfo(circuitBreakerOpen func(endpoint string) bool, endpoint string) *workflowpb.NexusOperationCancellationInfo {
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.

Suggested change
// ToCancellationInfo converts a CHASM Cancellation to the API NexusOperationCancellationInfo format.
func (o *Cancellation) ToCancellationInfo(circuitBreakerOpen func(endpoint string) bool, endpoint string) *workflowpb.NexusOperationCancellationInfo {
// ToWorkflowCancellationInfo converts a CHASM Cancellation to the API workflow.NexusOperationCancellationInfo format.
func (o *Cancellation) ToWorkflowCancellationInfo(circuitBreakerOpen func(endpoint string) bool, endpoint string) *workflowpb.NexusOperationCancellationInfo {

return nil
}

func pendingOperationState(status nexusoperationpb.OperationStatus) enumspb.PendingNexusOperationState {
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.

Same as above, it's part of standalone nexus.

Comment on lines +278 to +280
// ToPendingNexusOperationInfo converts a CHASM Operation to the API PendingNexusOperationInfo format.
// Returns nil if the operation is not in a pending state.
func (o *Operation) ToPendingNexusOperationInfo(
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.

Suggested change
// ToPendingNexusOperationInfo converts a CHASM Operation to the API PendingNexusOperationInfo format.
// Returns nil if the operation is not in a pending state.
func (o *Operation) ToPendingNexusOperationInfo(
// ToWorkflowPendingNexusOperationInfo converts a CHASM Operation to the API workflow.PendingNexusOperationInfo format.
// Returns nil if the operation is not in a pending state.
func (o *Operation) ToWorkflowPendingNexusOperationInfo(

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.

Also tempted to put this in chasm/lib/workflow instead because the component should be mostly agnostic to where it is used.

Comment on lines +297 to +300
if state == enumspb.PENDING_NEXUS_OPERATION_STATE_SCHEDULED && invocationCBOpen(o.Endpoint) {
state = enumspb.PENDING_NEXUS_OPERATION_STATE_BLOCKED
blockedReason = "The circuit breaker is open."
}
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.

@stephanos I don't remember seeing this in your standalone branch. Did we miss this?

}

// buildPendingNexusOperationInfosFromChasm reads nexus operations from the CHASM tree and converts them to API format.
func buildPendingNexusOperationInfosFromChasm(
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.

Move all of this to chasm/lib/workflow please.

Comment on lines +586 to +602
invocationBreaker := func(endpoint string) bool {
cb := outboundQueueCBPool.Get(tasks.TaskGroupNamespaceIDAndDestination{
TaskGroup: nexusoperations.TaskTypeInvocation,
NamespaceID: namespaceID.String(),
Destination: endpoint,
})
return cb.State() != gobreaker.StateClosed
}

cancellationBreaker := func(endpoint string) bool {
cb := outboundQueueCBPool.Get(tasks.TaskGroupNamespaceIDAndDestination{
TaskGroup: nexusoperations.TaskTypeCancelation,
NamespaceID: namespaceID.String(),
Destination: endpoint,
})
return cb.State() != gobreaker.StateClosed
}
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.

I think the task group is wrong here, it using definitions from the HSM implementation.

Let's also make sure we have a way to put both of these in the same task group. There's no need to separate them out. It's been an outstanding item for a while.

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