416
417
// TODO(carlydf): remove verbose logging
418
>
d.logger.Info("Continuing workflow as new",
workflow.go
419
>
"create_time", d.State.GetCreateTime(),
420
>
"routing_config", d.State.GetRoutingConfig(),
421
>
//nolint:staticcheck // SA1019: worker versioning v0.31
422
>
"current_version", d.State.GetRoutingConfig().GetCurrentVersion(),
423
>
//nolint:staticcheck // SA1019: worker versioning v0.31
424
>
"ramping_version", d.State.GetRoutingConfig().GetRampingVersion(),
425
>
"state_changed", d.stateChanged,
426
>
"force_can", d.forceCAN,
427
>
"workflow_id", workflow.GetInfo(ctx).WorkflowExecution.ID,
428
>
"run_id", workflow.GetInfo(ctx).WorkflowExecution.RunID)
429
>
430
>
// We perform a continue-as-new after each update and signal is handled to ensure compatibility
431
>
// even if the server rolls back to a previous minor version. By continuing-as-new,
432
>
// we pass the current state as input to the next workflow execution, resulting in a new
433
>
// workflow history with just two initial events. This minimizes the risk of NDE (Non-Deterministic Execution)
434
>
// errors during server rollbacks.
435
>
436
>
// Apply override state if provided during force-CaN
437
>
if d.overrideState != nil {
438
d.State = d.overrideState
439
}
440
>
return workflow.NewContinueAsNewError(ctx, WorkerDeploymentWorkflowType, d.WorkerDeploymentWorkflowArgs)
workflow.go
441
}
442