sdk-go icon indicating copy to clipboard operation
sdk-go copied to clipboard

WorkflowChecker should consider anonymous functions in local activities deterministic, but maybe warn about them anyway

Open Quinn-With-Two-Ns opened this issue 1 year ago • 0 comments

Expected Behavior

WorkflowChecker should consider anonymous functions in local activities deterministic.

Actual Behavior

WorkflowChecker does not consider anonymous functions in local activities deterministic.

Steps to Reproduce the Problem

func GreetingSample(ctx workflow.Context) error {
	fut := workflow.ExecuteLocalActivity(ctx, func(ctx context.Context) time.Time { return time.Now() })
}

Note

Anonymous functions as local activities are ripe for data races because they can run in parallel with the workflow function, so maybe we should warn about their use from that perspective.

Quinn-With-Two-Ns avatar Jan 09 '24 18:01 Quinn-With-Two-Ns