v1.26.0
Typed search attributes
Previously, search attributes were untyped maps with string keys and interface values. This causes ambiguity on what types a search attribute key represents and leads to errors. Also, the way search attributes were created or upserted allowed mistakes to occur and was not clear to the server exactly what was expected.
- Added
TypedSearchAttributes
toclient.ScheduleOptions
and deprecatedSearchAttributes
- Added
GetTypedSearchAttributes
toworkflow
and deprecatedWorkflowInfo.SearchAttributes
- Added UpsertTypedSearchAttributes to workflow and deprecated UpsertSearchAttributes
- Added
TypedSearchAttributes
toclient.StartWorkflowOptions
and deprecatedSearchAttributes
- Added several new things to temporal package including:
SearchAttributes
collection with methods and constructorSearchAttributeKey
andSearchAttributeUpdate
interfacesSearchAttributeKeyX
types and constructors for typed keys
π₯ BREAKING CHANGES
gogo/protobuf
gogo/protobuf
has been replaced with Google's official proto compiler.
Users may notice:
time.Time
in proto structs will now be timestamppb.Timestamptime.Duration
will now be durationpb.Duration- V2-generated structs embed locks, so you cannot dereference them.
- Proto enums will, when formatted to JSON, now be in SCREAMING_SNAKE_CASE rather than PascalCase.
- If trying to deserialize old JSON with PascalCase to proto use go.temporal.io/api/temporalproto
- If trying to deserialize old JSON with PascalCase to proto use go.temporal.io/api/temporalproto
Note on invalid UTF-8 data stored as proto strings
Prior to SDK version v1.26.0 our protobuf code generator allowed invalid UTF-8 data to be stored as proto strings. This isn't actually allowed by the proto3 spec, so if you're using our SDK and think you may store arbitrary binary data in our strings you should set -tags protolegacy
when building against our SDK.
Example:
$ go build -tags protolegacy myworker/main.go
If you see an error like grpc: error unmarshalling request: string field contains invalid UTF-8
then you will need to enable this when building your code.
If you're unsure then you should specify it anyways as there's no harm in doing so unless you relied on the protobuf compiler to ensure all strings were valid UTF-8.
HTTP/2 Keep Alive
HTTP/2 Keep alive is now enabled by default. This should help avoid request timeouts on previously idle connections. If users want to revert to the old behavior they can set ConnectionOptions.DisableKeepAliveCheck
to false.
See also: #1299
Typed search attributes
As part of typed search attributes most old untyped search attributes API were deprecated, but will continue to function as they always have been going forward some breaking changes were required.
See also: #1368
Breaking changes include:
- Added
TypedSearchAttributes
toclient.ScheduleWorkflowAction
and π₯removedSearchAttributes
and addedUntypedSearchAttributes
(needed until temporalio/temporal#4787 is fixed)
Workflow Update (Experimental)
Workflow update handlers are now processed eagerly before the main workflow function instead of after. This means coroutine ordering can change causing non-determinism. When calling workflow.SetUpdateHandler
and an update was received during that workflow task, and no other handlers have been set before, workflow.SetUpdateHandler
will trigger the queued update handlers to run.
Activity and Workflow mock name collision in Test Suite
Fixed a bug in the workflow test suite that would cause workflow and activity mocks that shared the same name to override each other. If your test was doing this and asserting on the number of times a mock was called you may notice a change in behavior as activity and workflow mocks are now stored in separate maps.
see also: #1371
π₯ Rollback Note
Due to this change in update processing , rolling back the SDK to a pre v1.26.0 version may cause workflow using workflow update (receiving update requests or registering an update handler) to get stuck with non determinism errors until they roll forward again.
Other changes
-
Tag
workflow_task_execution_failed
metric with error type to help differentiate workflow task failures caused by non determinism from other task failures -
Dump coroutine stack on deadlock timeout. When the SDK detects a deadlock it will now try to dump the stack trace of the coroutine it detected as deadlocked.
-
Add deterministic range over map helper. Iterating over Go's standard maps is not deterministic and therefore cannot be done in a workflow context. The SDK now includes helpers
DeterministicKeys
andDeterministicKeysFunc
to get the keys of a map in a deterministic order.
Specific Changes
2023-10-13 - 06c90fb - Propagate Baggage in OTEL tracing interceptor (#1260)
2023-10-26 - 3cccbdd - Fix error documentation typos and enum values (#1276)
2023-10-31 - 0352634 - Add EmitDefault option for ProtoJson converter (#1286)
2023-11-08 - 0e432a9 - Add context propagators to local activity executions through test environments (#1291)
2023-11-08 - 4663bab - Fix typo in documentation (#1288)
2023-11-17 - 8068455 - Delete .github/workflows/semgrep.yml (#1294)
2023-11-21 - f9d73bf - Replace gogo protobuf (#1256)
2023-11-22 - 7db0d87 - Use the official features repo (#1298)
2023-11-27 - 745e948 - Add NotBefore
function to testsuite.MockCallWrapper
(#1301)
2023-11-27 - f5a0127 - Edit docstrings (#1302)
2023-11-28 - 33e8360 - Multi-platform CI and Makefile removal (#1293)
2023-11-28 - 70c8400 - Fix doc typo (#1305)
2023-11-28 - 8f2a3c8 - Use our new JSON coding stack (#1307)
2023-11-29 - 288a04f - Bump api-go version to fix Payload marshaling (#1308)
2023-11-29 - 89c8dba - Enabled keep alive by default (#1299)
2023-11-30 - 266e049 - Fix race in WaitSignalReturnParam (#1309)
2023-11-30 - 802d32e - Run cloud tests in series to avoid wfID conflict (#1311)
2023-11-30 - a309e59 - Tag workflow_task_execution_failed with error type (#1295)
2023-12-04 - 5fdbecc - Handle updates immediately when registered (#1306)
2023-12-04 - 838121a - Don't run workflowCancelHandler in test harness (#1296)
2023-12-04 - 987379d - Make remoteDataConverter implement PayloadCodec (#1303)
2023-12-04 - eb05747 - Fix flaky test (#1314)
2023-12-07 - 5d5b9c4 - Fix typo in docstring (#1317)
2023-12-14 - 7a9640d - Fix typo in update docstring (#1321)
2023-12-15 - f823b64 - Cleanup dead code and incorrect use of go routine in context pkg (#1320)
2023-12-27 - 95fe6ab - Fix bad Update mock in NamespaceClient (#1328)
2023-12-30 - 5a64898 - Failed Read-Only check causes a WFT failure in validator (#1329)
2024-01-04 - cb1d35e - Update dd-trace-go.v1 (#1332)
2024-01-05 - 2f61d2f - Add last BuildID to workflow info (#1335)
2024-01-07 - 7fc12d3 - Add otel metrics support (#1336)
2024-01-08 - 6244097 - Include update state machine fields in panic (#1327)
2024-01-08 - c1744ee - Bump go-api version to fix protojson vuln (#1333)
2024-01-09 - 1fe10d5 - Fix flaky build id issue (#1338)
2024-01-09 - 5ca9a4d - Add deterministic range over map helper (#1340)
2024-01-13 - fac7f7f - Update WorkflowRun.Get Doc String (#1346)
2024-01-16 - 0f12265 - Replace go.uber.org/atomic with sync/atomic (#1344)
2024-01-16 - 41d2288 - Evict workflow from cache on RespondTaskCompleted failure (#1358)
2024-01-16 - 54e131e - Make dataConverterWithoutDeadlock context aware (#1348)
2024-01-17 - 14103e0 - regenerate mocks with latest mockery (#1361)
2024-01-17 - 50ab40d - regenerate mocks under client to allow dynamic returns based on arguments (#1353)
2024-01-17 - 55c39b5 - Disable eager activities if tq rate limits is set (#1350)
2024-01-17 - b50cce9 - Replace some Sprintfs with string concatenation (#1345)
2024-01-17 - e3a3d95 - Always yield when registering update handles (#1325)
2024-01-19 - 14ddd7b - Dump coroutine stack on deadlock timeout (#1356)
2024-01-22 - 171504d - Fail task on unknown event when HistoryEvent.worker_may_ignore is false (#1363)
2024-01-22 - 30b2681 - Exit coroutine in order (#1362)
2024-01-22 - 94a5f5f - Allow client to suggest delay until next retry (#1319)
2024-01-26 - 536b875 - Exclude codes.DeadlineExceeded from the list of retryable gRPC codes (#1366)
2024-02-01 - 57b6679 - Typed Search Attributes (#1368)
2024-02-01 - 86764f8 - Handle nil valuePtr case in update handler Get (#1373)
2024-02-01 - a7c9528 - Prefix some errors with rule identifiers (#1281)
2024-02-01 - e2bec16 - Fix testing suite name conflict for workflow and activity (#887) (#1371)
2024-02-02 - 5c8c9a3 - Release Go SDK version 1.26.0-RC.1 (#1374)
2024-02-05 - 262766c - Fix data race on desiredWorkflowCacheSize (#1377)
2024-02-08 - 246a7d2 - Rectify the default values for keep-alive timeout (#1381)
2024-02-08 - 72a5b6f - workflowcheck: bump golang.org/x/tools from 0.13.0 to 0.17.0 (#1379)
2024-02-13 - d39fa9d - Add support for typed search attributes to the test suite (#1378)
2024-02-14 - 30da688 - Introduce a new constructor to override retry policy in ContinueAsNewError (#1383)
2024-02-20 - 5621b7f - Clarify OnUpsertTypedSearchAttributes (#1391)
2024-02-20 - 65aae9b - Document GetSearchAttributes is not supported on cloud (#1388)
2024-02-21 - 6d4ec2d - Make it possible to cancel workflows by ID when testing (#1392)
2024-02-22 - a71e4c4 - Update CI to Go lang 1.22 (#1389)
2024-02-27 - 34ef0a7 - Only set SDKPriorityUpdateHandling if workflow update is being used (#1398)
2024-02-27 - 54b2336 - Add note NextRetryDelay is not supported on the server (#1400)
2024-02-29 - d9a574d - Update workflow check with new function added in the SDK (#1403)
2024-03-01 - efabf46 - Update api-go to allow invalid UTF-8 in proto strings (#1407)
2024-03-08 - 1052374 - API key support via credentials abstraction (#1409)
2024-03-11 - 3b9c572 - Override API key with user metadata (#1419)
2024-03-11 - 682cca0 - Update both protobuf dependencies (#1417)