github temporalio/sdk-go v1.52.0

one hour ago

Notable Changes

Added

  • Workflows can inspect cancellation causes with workflow.Cause and cancel local contexts with workflow.WithCancelCause. Reasons supplied through client.CancelWorkflowWithOptions or the new workflow.RequestCancelExternalWorkflowWithOptions are available as cancellation causes inside the target workflow. Context.Err() continues to return workflow.ErrCanceled. External- and child-workflow cancellation requests inherit the context's cause when no nonempty reason is supplied.

  • internalbindings.WorkflowEnvironment exposes GetCancellationReason and reason parameters on child- and external-workflow cancellation requests for SDKs built on top of the Go SDK.

  • Experimental: converter.StorageDriverStoreContext and converter.StorageDriverSelectContext have a Namespace field holding the namespace of the client or worker performing the operation, so drivers and selectors can partition by namespace even when there is no Target.

  • Experimental: Added worker.GetInfo, which returns a snapshot of a worker's state, currently its task slot usage.

Changed

  • Reduced gRPC interceptor allocations when the effective metrics handler is a no-op.

  • converter.NewZlibCodec reuses zlib writers and readers across payloads instead of creating them for every payload. A writer is about 1 MB of allocation, so encoding allocates far less, which reduces garbage collection in workers that encode many payloads. The encoded output is unchanged.

  • Removed an allocation when resolving workflow and activity function names.

  • Reduced allocations when converting batches of values to payloads.

Fixed

  • Retry transient Temporal CLI download failures when starting a dev server with testsuite.StartDevServer.

  • Marked workflow.SignalWithStart as experimental.

  • client.Options.SdkName and client.Options.SdkVersion now also apply to the SDK metadata of workflow task completions, not only to worker heartbeats.

  • Workers no longer advertise a worker control task queue unless worker heartbeats and commands are supported and the shared namespace command poller is running.

  • Workers let the server complete outstanding worker-command polls on namespaces that support graceful poll shutdown.

  • Fixed session-worker updates overwriting ordinary activity-worker gauges and distorting worker heartbeats. Session metrics are exported under the task queues they poll, and the activity heartbeat reports only the ordinary activity worker.

What's Changed

New Contributors

Full Changelog: v1.51.0...v1.52.0

Don't miss a new sdk-go release

NewReleases is sending notifications on new releases.