sdk-go
sdk-go copied to clipboard
Worker versioning + workflow session
Expected Behavior
Calling workflow.CreateSessio, while using a versioned worker, creates a new session context for that worker.
Actual Behavior
The new session has no worker; "internalSessionCreationActivity" will timeout:
activity error (type: internalSessionCreationActivity, scheduledEventID: 6, startedEventID: 0, identity: ): activity ScheduleToStart timeout (type: ScheduleToStart) ;
Could it be because this internal activity has the following attribute: Use Compatible Version false (as seen in the UI)?
Steps to Reproduce the Problem
- set a worker version via the SDK as follows:
func setTemporalTaskQueueDefaultVersion(temporalClient client.Client, taskQueue string, buildId string) error {
if err := temporalClient.UpdateWorkerBuildIdCompatibility(context.Background(), &client.UpdateWorkerBuildIdCompatibilityOptions{
TaskQueue: taskQueue,
Operation: &client.BuildIDOpAddNewIDInNewDefaultSet{
BuildID: buildId,
},
}); err != nil {
return err
}
return nil
}
- Then, use that version in the worker:
w := worker.New(temporalClient, workflows.QueueName, worker.Options{
EnableSessionWorker: true,
BuildID: *buildId,
UseBuildIDForVersioning: useBuildIDForVersioning,
})
- Now, in a workflow, when you call:
activityOptions := workflow.ActivityOptions{
StartToCloseTimeout: 60 * time.Minute,
RetryPolicy: &temporal.RetryPolicy{
MaximumAttempts: 2,
},
TaskQueue: QueueName,
}
ctx = workflow.WithActivityOptions(ctx, activityOptions)
so := &workflow.SessionOptions{
CreationTimeout: time.Minute,
ExecutionTimeout: time.Hour,
}
ctx, err := workflow.CreateSession(ctx, so)
if err != nil {
return nil, err
}
defer workflow.CompleteSession(ctx)
Specifications
- Version: v1.24.0
- Platform: Linux
Unfortunately worker versioning and sessions are not compatible at this time because the task queue used for internalSessionCreationActivity , the activity responsible for creating the session, does not have the same version info as the original task queue and the server has no way to link two task queues together.