Releases: uber-go/cadence-client
v0.7.1 Release
New features
- Sync API: Frontend:ListDomains Admin: DescribeHistoryHost (#508)
- Sync API defs from server repo (#506)
- Replay history from file (#500) [Bowei Xu]
- Add workflowID in result of ExecuteWorkflow (#491)
- Update RespondDecisionTaskCompleted idl (#492)
- add admin.thrift and expose autogenerated stubs (#489)
- Add ResetStickyTaskList API to cadence client (#486)
Bug fixes
- Log metrics and do not panic when the channel receives a corrupted signal (#513)
- Fix service wrapper init for metrics (#515)
- error getDetails (#514)
- Clean up .gen/go/admin/adminservice_inquiryworkflowexecution.go (#510)
- Return Nil as result from testsuite on error (#505)
- Fix firewall warning of client in readme (#504)
- handle long running decision (#498)
- Fix typo in NewCustomError (#499) [yiminc]
- fix chained future (#488)
Miscellaneous
- Improve metrics with workflow and activity type (#509)
- change long poll history timeout (#512)
- Refactor workflowExecutionContext (#501)
- Rename MaxConcurrentWorkflow constants (#502)
- Adjust defaultMaxConcurrentTask from 50 to 1000 (#503)
- Update comments in workerOptions (#494)
- Reset workflow stickiness on eviction (#496)
v0.7.0 Release
Break change
- (#449) DomainClient Describe and Update functions' signature changed to
Describe(ctx context.Context, name string) (*s.DescribeDomainResponse, error)
Update(ctx context.Context, request *s.UpdateDomainRequest) error
- (#480) Removed special channel for signal since not needed anymore
New features
- Add ability to mock start child workflow failed case (#444)
- Added worker.ReplayWorkflowHistory and ReplayWorkflowExecution (#441) doc
- Refactor domain client update and describe for crossdc (#449)
- Expose method to set sticky cache size (#455)
- Optimize cancellation via context (#461)
- Add non-deterministic workflow option (#475)
- Add Data Converter to support custom serialization/deserialization (#463) doc
- Add SetTestTimeout for TestActivityEnvironment (#484)
Bug fixes
Memory leak fixes
- Sticky cache metrics (#453)
- Do not keep reference for the whole history during decision process (#457)
- Fix closure leak (#460)
- Separate input from activityOptions (#465)
- Fix signal leak (#471)
- Fix for re-slicing leak (#472)
Other fixes
- Fix test signal external workflow (#446)
- Check nil before stop workflow worker (#450)
- Fix for client.ExecuteWorkflow bug (#452)
- Release workflow when sticky is not enabled (#456)
- Fix flaky test (#458)
- Clear current decision task on sticky workflow state when complete it (#462)
- Fix replay time (#470)
- Fix nil pointer (#473)
- Fix TestDispatchClose (#483)
Miscellaneous
- Un-pin zap, bump to a newer version to pull in zaptest logger (#438)
- Bump Go tool version to 1.10 in travis.ci (#466)
- RunID optional for DescribeWorkflowExecution (#468)
- Sync idl file from server (#477)
- Clean up / optimize makefile, sandbox builds better. (#474)
- Remove SignalChannel (#480)
- Release verison 0.7.0 (#485)
- Add tag ClientImpl to all metrics (#482)
v0.6.1 Release
New features
- Add tags to metrics (#414)
- Add SignalWithStart (#422) doc
- add SignalChannel interface (#425) doc
- side effect with ID (#428) doc
- Add Decoder API NewValue in client (#435) doc
Bug fixes
- init mock clock with current time (#424)
- fix context misuse (#427)
- Fix unit tests missed assert mocks expectation (#429)
- Dump all registered activities when activity not found (#437)
Miscellaneous
v0.6.0 Release
Local activity
- adding local activity (#340)
- test support for local activity (#357)
- do not pump poller request channel for local activity result (#410)
- fix local activity worker (#411)
Local activity is added to address the use case where a large number of activities are created on each decision task, and each activity is very simple and short lived, and they needs to be completed quickly.
Some key difference between local activity and regular activity are:
- Local activity is scheduled and run by the workflow worker locally.
- Local activity does not need Cadence server to schedule activity task and does not rely on activity worker.
- No need to register local activity.
- The parameter activity to ExecuteLocalActivity() must be a function.
- Local activity is for short living activities (usually finishes within seconds).
- Local activity cannot heartbeat.
See docs for local activity: https://github.com/uber-go/cadence-client/blob/8e121e2d2a6fae71c403d5070139c2881a83aad4/workflow/workflow.go#L157
New features
- Add SignalExternalWorkflow Decision (#329)
- test framework support for SignalExternalWorkflow (#384)
- disconnected context (#404)
With disconnected context, workflow could do cleanup even after been canceled. - Add RecordActivityHeartbeatByID (#417)
- expose is replaying flag (#419)
Bug fixes
- bugfix: test tag should have type string (#364)
- Use domain name in completeActivityByID instead of domainID (#362)
- fix nil argument to activity (#365)
- Activity options fix for #372 (#373)
- fix potential nil pointer error (#371)
- properly handle start child workflow failed (#403)
- non-deterministic check for signal external workflow (#409)
- fix marker state machine (#412)
- fix mock (#413)
- should use initiated event ID instead of control / signal ID (#415)
- Fix client side cancellation && signal (#401)
- fix selector (#416)
Miscellaneous
- update testify to v1.2.0 (#353)
- only check function name of child workflow for non-deterministic (#356)
- delete dead code (#358)
- Add isStickyTask to poll request (#355)
- redefine Client/DomainClient as public interface (#370)
- update GetVersion() doc (#382)
- use math.Ceil for timeout (#383)
- TimeoutError.Details() no panic (#386)
- adding helper methods to check error type (#385)
- send signal to child workflow from ChildWorkflowFuture (#387)
- clean up decision state machine collections (#389)
- Added missing fields into activity.Info (#395)
v0.5.0 Release
New Features and Improvements:
Breaking changes
Refactored cadence client from a single package to multiple packages. #300 #343
We hear feedback that our godoc was not usable because it mixes internal stuff with public APIs. So we decided to refactor our client library to better organize the code into multiple namespaces and hide internal implementation into its own internal package.
All customers who are using the existing cadence client will have to do manual upgrade to the newest client.
Note: no major behavior change is introduced in this upgrade, only thing customer have to do is string replacement.
Note: minimum required Go version for this release is 1.9.
- Moved cadence package into internal
- Added client, activity, workflow, encoded, worker, testsuite public packages that compose Cadence client public API. It used Type alias Go feature. That bumped minimal required Go version to 1.9.
- Renamed methods to comply with Go style. For example cadence.RegisterWorkflow became workflow.Register.
- Updated README to mention GetVersion
- Changed .travis.yml to use go 1.9
- Updated CONTRIBUTING to indicate minimum required Go version as 1.9
- Fixed Makefile to not run glide install on every invocation.
Please follow the steps below for upgrading.
- Change the glide.yaml to
- package: go.uber.org/cadence
version: ^0.5.0
subpackages:
- .gen/go/cadence
OR
Change glide.lock and change the following (this is an example)
Before:
- name: go.uber.org/cadence
version: 26b7a248b5d668006b959fa32f0d890659611c82
subpackages:
- .gen/go/cadence
- .gen/go/cadence/workflowserviceclient
- .gen/go/cadence/workflowservicetest
- .gen/go/shared
- common
- common/backoff
- common/cache
- common/metrics
- common/util
After:
- name: go.uber.org/cadence
version: e7123e7586e43a82c0a658403523f890d14668a9
subpackages:
- .gen/go/cadence
- .gen/go/cadence/workflowserviceclient
- .gen/go/cadence/workflowservicetest
- .gen/go/shared
- activity
- client
- encoded
- testsuite
- worker
- workflow
- In the terminal, do
glide install
- Change each go source file, with the following change, accordingly
# WORKER #
## import ##
"go.uber.org/cadence" -> "go.uber.org/cadence/worker"
## source ##
cadence.EnableVerboseLogging -> worker.EnableVerboseLogging
cadence.NewWorker -> worker.New
cadence.WorkerOptions -> worker.Options
cadence.Worker -> worker.Worker
# CLIENT #
## import ##
"go.uber.org/cadence" -> "go.uber.org/cadence/workflow"
## source ##
cadence.Client -> client.Client
cadence.ClientOptions -> client.Options
cadence.DomainClient -> client.DomainClient
cadence.StartWorkflowOptions -> client.StartWorkflowOptions
cadence.NewClient -> client.NewClient
cadence.NewDomainClient -> client.NewDomainClient
# WORKFLOW #
## import ##
"go.uber.org/cadence" -> "go.uber.org/cadence/workflow"
## source ##
cadence.ActivityOptions -> workflow.ActivityOptions
cadence.CancelFunc -> workflow.CancelFunc
cadence.Channel -> workflow.Channel
cadence.ChildWorkflowFuture -> workflow.ChildWorkflowFuture
cadence.ChildWorkflowOptions -> workflow.ChildWorkflowOptions
cadence.ChildWorkflowPolicy -> workflow.ChildWorkflowPolicy
cadence.ChildWorkflowPolicyAbandon -> workflow.ChildWorkflowPolicyAbandon
cadence.ChildWorkflowPolicyRequestCancel -> workflow.ChildWorkflowPolicyRequestCancel
cadence.ChildWorkflowPolicyTerminate -> workflow.ChildWorkflowPolicyTerminate
cadence.Context -> workflow.Context
cadence.ContinueAsNewError -> workflow.ContinueAsNewError
cadence.DefaultVersion -> workflow.DefaultVersion
cadence.ErrCanceled -> workflow.ErrCanceled
cadence.ErrDeadlineExceeded -> workflow.ErrDeadlineExceeded
cadence.ExecuteActivity -> workflow.ExecuteActivity
cadence.ExecuteChildWorkflow -> workflow.ExecuteChildWorkflow
cadence.Future -> workflow.Future
cadence.GenericError -> workflow.GenericError
cadence.GetLogger -> workflow.GetLogger
cadence.GetMetricsScope -> workflow.GetMetricsScope
cadence.GetSignalChannel -> workflow.GetSignalChannel
cadence.GetVersion -> workflow.GetVersion
cadence.GetWorkflowInfo -> workflow.GetInfo
cadence.Go -> workflow.Go
cadence.GoNamed -=> workflow.GoNamed
cadence.NewBufferedChannel -> workflow.NewBufferedChannel
cadence.NewChannel -> workflow.NewChannel
cadence.NewContinueAsNewError -> workflow.NewContinueAsNewError
cadence.NewFuture -> workflow.NewFuture
cadence.NewHeartbeatTimeoutError -> workflow.NewHeartbeatTimeoutError
cadence.NewNamedBufferedChannel -> workflow.NewNamedBufferedChannel
cadence.NewNamedChannel -> workflow.NewNamedChannel
cadence.NewNamedSelector -> workflow.NewNamedSelector
cadence.NewSelector -> workflow.NewSelector
cadence.NewTimeoutError -> workflow.NewTimeoutError
cadence.NewTimer -> workflow.NewTimer
cadence.Now -> workflow.Now
cadence.PanicError -> workflow.PanicError
cadence.RegisterWorkflow -> workflow.Register
cadence.RegisterWorkflowOptions -> workflow.RegisterOptions
cadence.RegisterWorkflowWithOptions -> workflow.RegisterWithOptions
cadence.RequestCancelWorkflow -> workflow.RequestCancelWorkflow
cadence.Selector -> workflow.Selector
cadence.SetQueryHandler -> workflow.SetQueryHandler
cadence.Settable -> workflow.Settable
cadence.SideEffect -> workflow.SideEffect
cadence.Sleep -> workflow.Sleep
cadence.TimeoutError -> workflow.TimeoutError
cadence.Version -> workflow.Version
cadence.WithActivityOptions -> workflow.WithActivityOptions
cadence.WithCancel -> workflow.WithCancel
cadence.WithChildPolicy -> workflow.WithChildPolicy
cadence.WithChildWorkflowOptions -> workflow.WithChildOptions
cadence.WithExecutionStartToCloseTimeout -> workflow.WithExecutionStartToCloseTimeout
cadence.WithHeartbeatTimeout -> workflow.WithHeartbeatTimeout
cadence.WithScheduleToCloseTimeout -> workflow.WithScheduleToCloseTimeout
cadence.WithScheduleToStartTimeout -> workflow.WithScheduleToStartTimeout
cadence.WithStartToCloseTimeout ->workflow.WithStartToCloseTimeout
cadence.WithTaskList -> workflow.WithTaskList
cadence.WithValue -> workflow.WithValue
cadence.WithWaitForCancellation -> workflow.WithWaitForCancellation
cadence.WithWorkflowDomain -> workflow.WithWorkflowDomain
cadence.WithWorkflowID -> workflow.WithWorkflowID
cadence.WithWorkflowTaskList -> workflow.WithWorkflowTaskList
cadence.WithWorkflowTaskStartToCloseTimeout -> workflow.WithWorkflowTaskStartToCloseTimeout
cadence.WorkflowExecution -> workflow.Execution
cadence.WorkflowInfo -> workflow.Info
cadence.WorkflowType -> workflow.Type
# ACTIVITY #
## import ##
"go.uber.org/cadence" -> "go.uber.org/cadence/activity"
## source ##
cadence.ActivityInfo -> activity.Info
cadence.ActivityType -> activity.Type
cadence.ErrActivityResultPending -> activity.ErrResultPending
cadence.GetActivityInfo -> activity.GetInfo
cadence.GetActivityLogger -> activity.GetLogger
cadence.GetActivityMetricsScope -> activity.GetMetricsScope
cadence.RecordActivityHeartbeat -> activity.RecordHeartbeat
cadence.RegisterActivity -> activity.Register
cadence.RegisterActivityOptions -> activity.RegisterOptions
cadence.RegisterActivityWithOptions -> activity.RegisterWithOptions
# CODEC #
## import ##
"go.uber.org/cadence" -> "go.uber.org/cadence/encoded"
## source ##
cadence.EncodedValue -> encoded.Value
cadence.EncodedValues -> encoded.Values
# TEST #
## import ##
"go.uber.org/cadence" -> "go.uber.org/cadence/testsuite"
## source ##
cadence.MockCallWrapper -> testsuite.MockCallWrapper
cadence.ServiceInvoker -> testsuite.ServiceInvoker
cadence.TestActivityEnvironment -> testsuite.TestActivityEnvironment
cadence.TestWorkflowEnvironment -> testsuite.TestWorkflowEnvironment
cadence.WithActivityTask -> testsuite.WithActivityTask
cadence.WorkflowTestSuite -> testsuite.WorkflowTestSuite
Change the signature of GetWorkflowHistory from returning whole history to history event iterator #328
workflowID := "workflow-ID"
workflowRunID := // if this is empty string, will use the current run ID of workflow above
// whether use long poll for tracking new events: when the workflow is running, there can be new events generated during iteration
// of HistoryEventIterator, if isLongPoll == true, then iterator will do long poll, tracking new history event, i.e. the iteration
// will not be finished until workflow is finished; if isLongPoll == false, then iterator will only return current history events.
isLongPoll := true
// whether return all history events or just last event
filterType := shared.HistoryEventFilterTypeAllEvent // can also be shared.HistoryEventFilterTypeCloseEvent
iter := client.GetWorkflowHistory(context.Background(), workflowID, workflowRunID, isLongPoll, filterType)
for iter.HasNext() {
event, err := iter.Next()
if err != nil {
return err
}
events = append(events, event)
}
Expose WorkflowIDReusePolicy #328 #338
The new WorkflowIDReusePolicy allow customer to specify the behavior of Cadence service when a workflow is started with the same workflow ID:
-
shared.WorkflowIDReusePolicyAllowDuplicateFailedOnly allow start a workflow execution when workflow not running, and the last execution close state is in [terminated, cancelled, timeout, failed].
-
shared.WorkflowIDReusePolicyAllowDuplicate allow start a workflow execution using the same workflow ID, when workflow not running.
-
shared.WorkflowIDReusePolicyRejectDuplicate do not allow start a workflow execution using the same workflow ID at all.
Note: There is a behavior change in the start workflow / start child workflow workflow ID reuse policy, previously, the default behavior is WorkflowIDReusePolicyAllowDuplicate, while after this change, the default behavior is WorkflowIDReusePolicyAllowDuplicateFailedOnly
Example fo...
v0.4.1 Release
New Features and Improvements:
Breaking changes
- Upgrade client to thriftrw changes (#246)
Note: we switched RPC from directly using tchannel to yarpc. Part of that change is switching from using thrift to thriftrw to generate thrift client code (#246). This means the thrift client is now workflowserviceclient.Interface instead of cadence.TChanWorkflowService. Below APIs which used to require cadence.TChanWorkflowService are now requiring workflowserviceclient.Interface. Calls to those APIs will needs a proper update:
- cadence.NewClient(...)
- cadence.NewDomainClient(...)
- cadence.NewWorker(...)
To create a workflowserviceclient.Interface instance, you need a yarpc.Dispatcher. Below is a simplified sample code to do so:
import (
"go.uber.org/cadence/.gen/go/cadence/workflowserviceclient"
"go.uber.org/yarpc"
"go.uber.org/yarpc/transport/tchannel"
)
var _cadenceFrontendService = "cadence-frontend"
func createCadenceServiceClient() workflowserviceclient.Interface {
tch, _ := tchannel.NewChannelTransport(tchannel.ServiceName(_cadenceFrontendService))
dispatcher = yarpc.NewDispatcher(yarpc.Config{
Name: "cadence-client",
Outbounds: yarpc.Outbounds{
_cadenceFrontendService: {Unary: tch.NewSingleOutbound("127.0.0.1:7933")},
},
})
serviceClient := workflowserviceclient.New(dispatcher.ClientConfig(_cadenceFrontendService))
return serviceClient
}
Sticky decision
- add sticky decision task list (#267)
- fix sticky attributes (#270)
- add lru cache (#273)
- partial history (#277)
- drain sticky task list first (#286)
- fix sticky state (#303)
New features
Bug fixes
- fix coroutinue leak before workflow completed (#245)
- fix race candition in test framework (#284)
- fix mock behavior (#261)
Miscellaneous
v0.4.0 Release
New Features and Improvements:
Query Support
- 70e6c21 update idl for query API (#224)
- 368b3cf query API client impl (#226)
- 1a0a0b7 detect blocking call in query handler (#227)
Breaking changes
Use JSON as default encoding
Bug fixes
- b625205 fix cadence.Now() (#222)
- a01ec47 fix unit test framework (#233)
- 614a82a fix rate limiter bug (#230)
- b13ab9c no retry when context is done (#241)
Miscellaneous
- ab0bf9b fix flakey unit test (#238)
- 5cba128 Increase poll backoff exponential timeouts. (#215)
- 6045e70 set worker options field only when it is not nil (#220)
- 7266d0f add cadence- prefix to all metrics emit from library (#219)
- 9513eba Fix and add negative test case for fully qualified function name string (#213)
v0.3.1 Release
New Features and Improvements:
Workflow Versioning
Registration of custom names/aliases for Workflows/Activities.
Client side metrics
- c6468e1 - Report metrics from workflow code (#195)
- 01c17dd - Add client side metrics and cadence service call/usage metrics (#197)
Worker Improvements
- 004aa7c - Decouple heart beating from client to server (#167)
- a123c60 - Improved worker threading model (#186)
Workflow Debuggability
Support cross platform activities
Bug fixes
- 9daa9ef - Pagination to use workflow iterator to get next set of events(#177)
- 0513a5e - Select Future stale registered callback can modify state (#185)
- 841e526 - Worker suppress noisy logs
- d035c59 - Reorder events slice duplicating events (#188)
- a8ef7c6 - Validate domain existence at worker start time (#196)
- 25aa0fe - Pick up tchannel fix to inform server about termination of connections by client (#199)
Miscellaneous
- e52d6fe - Test framework to remove Override activity in favor of OnActivity from test suite (#203)
- c9819c3 - Test framework to propagate timeouts in test suite (#209)
- befa5a1 - Rate limiter to support fractions as configuration per second (#192)
- 16afa48 - Cleanup logrus imports (#184)
- 6efb266 - Worker to have clean shutdown and option to have a blocking call (#183)
Cadence Client v0.3.0
New Features and Improvements
Child Workflow Support for Unit Test Framework
Workflow Panic To Fail DecisionTask
Breaking Changes
Bug Fixes
- 22481f1 - fix noisy logging for non-deterministic unit test (#156)
- f94a19b - fix clock for test suite (#157)
- 73ca6f3 - Check for not passing nil to encoder #92 (#159)
- 4c8e178 - fix data race (#163)
- ba6a088 - allow mock to wait on workflow clock before it returns (#164)
Miscellaneous
Cadence Client v0.2.0
New Features and Improvements
Child Workflow Support
Workflow Cancellation Support
- c12d46b - Workflow Cancellation Client (#46)
- 8f9ecd4 - Cancel request to remember cancel if the context is not created yet. (#100)
Unit Test Framework
- 743f0b3 - workflow unit test framework (#91)
- d2eb23b - fix clock for unit test framework (#105)
- 46a32d2 - check in copy of mock AS IS from testify (#113)
- 497248a - add mock support for unit test framework (#110)
History Pagination
Signal Support
Client Versioning
- 887a3f0 - send client-lib-version with every rpc call (#95)
- b309ad8 - auto-generate const for libversion and git-sha (#98)
Support for Side Effects
Activity and Workflow Panic Handling
- 93b8c58 - add panic handler to activity handler (#76)
- 49f0d04 - Workflow panic from this change fails decision not the workflow (#117)
Activity Context Deadline
Client Metrics
Breaking Changes
Open Sourcing
- 1094ef2 - add copyright header to all files;automate header generation (#103)
- 4f282f6 - Enable golint / gofmt checks at make time (#108)
- e5ca038 - revert autogeneration of version.go (#107)
- 367f882 - Update README.md (#124)
- 5e2ceda - Peer review for open sourcing Cadence client (#126)
- 02e659e - fix lint (#104)
Bug Fixes
- 62074e3 - DecodeFuture to work with select and chain (#75)
- eb9fb5d - Complete Activity (#77)
- 8051633 - Single dispatch per decision (#85)
- 7921a83 - remove leftover userContext (#86)
- b20ca74 - Remove fnSignature and encode values directly (#78)
- 254120f - some bug fixes uncovered while working on unit test (#88)
- 904d4bb - cleanup: tchannelContext with defaults options (#96)
- d84261c - move code to internal_workflow_testsuite.go (#97)
- c486a10 - Close race condition fix (#94)
- de31cc3 - Fix workflow suite data race (#131)
- 292d1a9 - fix future.Get (#127)
Miscellaneous
- b9997aa - Port latest IDL changes from cadence-server (#93)
- 1eaf329 - add OnActivityCompletedListener, OnActivityCancelledListener, OnActivityHeartbeatListener (#99)
- 738d8c3 - is decision event (#111)
- 5cf1502 - download glint package. (#115)
- b4b9d16 - update tests (#114)
- c5dbf3e - exclude mock.go from lint (#116)
- 219ffca - do not import testing package for production code (#101)
- 0785e35 - rename test handles to avoid name conflict (#143)
- 81a1339 - Cleanup metrics constants (#139)
- 1ccaa4a - Version 0.2.0 of the client release (#145)