Skip to content

Releases: uber-go/cadence-client

v0.7.1 Release

03 Jul 22:43
Compare
Choose a tag to compare

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

25 May 22:55
8f3c241
Compare
Choose a tag to compare

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

18 Apr 18:51
72dadb9
Compare
Choose a tag to compare

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

  • Add wrapper test (#426)
  • Fix lint issue from context.WithValue (#431)
  • Actually detect the existing lint failures (#430)
  • fix misspell (#436)

v0.6.0 Release

13 Mar 17:05
8e121e2
Compare
Choose a tag to compare

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

17 Jan 21:37
e7123e7
Compare
Choose a tag to compare

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.

  1. Moved cadence package into internal
  2. 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.
  3. Renamed methods to comply with Go style. For example cadence.RegisterWorkflow became workflow.Register.
  4. Updated README to mention GetVersion
  5. Changed .travis.yml to use go 1.9
  6. Updated CONTRIBUTING to indicate minimum required Go version as 1.9
  7. Fixed Makefile to not run glide install on every invocation.

Please follow the steps below for upgrading.

  1. 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
  1. In the terminal, do
glide install
  1. 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:

  1. shared.WorkflowIDReusePolicyAllowDuplicateFailedOnly allow start a workflow execution when workflow not running, and the last execution close state is in [terminated, cancelled, timeout, failed].

  2. shared.WorkflowIDReusePolicyAllowDuplicate allow start a workflow execution using the same workflow ID, when workflow not running.

  3. 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...

Read more

v0.4.1 Release

05 Dec 02:05
26b7a24
Compare
Choose a tag to compare

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

  • add DescribeWorkflowExecution client side change (#285)
  • Complete Activity by ID (#291)

Bug fixes

  • fix coroutinue leak before workflow completed (#245)
  • fix race candition in test framework (#284)
  • fix mock behavior (#261)

Miscellaneous

  • print unexpected mock calls (#252)
  • update cadence.Sleep() doc (#264)
  • update doc (#266)
  • Passing headers through yarpc call options (#249)
  • remove GetWorkflowStackTrack from client API (#276)

v0.4.0 Release

03 Oct 18:49
Compare
Choose a tag to compare

New Features and Improvements:

Query Support

Breaking changes

  • 815dd18 adding context as first parameter to all methods on our client (#239)

Use JSON as default encoding

Bug fixes

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

09 Aug 17:33
Compare
Choose a tag to compare

New Features and Improvements:

Workflow Versioning

Registration of custom names/aliases for Workflows/Activities.

  • 0116f47 - Add ability to register and to support custom names for workflows/activities (#205)

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

  • 47ca9f7 - Get thread dump of a workflow in progress (#176)

Support cross platform activities

  • c13cbb6 - Client library to use Thrift serialize for Thrift types automatically (#202)

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

28 Jun 23:55
Compare
Choose a tag to compare
Cadence Client v0.3.0 Pre-release
Pre-release

New Features and Improvements

Child Workflow Support for Unit Test Framework

  • 8b4f038 - add child workflow support to test suite (#148)

Workflow Panic To Fail DecisionTask

  • e14e853 - Workflow panic to fail decision task (#158)

Breaking Changes

Bug Fixes

Miscellaneous

Cadence Client v0.2.0

06 Jun 21:59
Compare
Choose a tag to compare
Cadence Client v0.2.0 Pre-release
Pre-release

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

History Pagination

  • 0bd0ffd - Iterate to get all pages when reading history (#123)

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

  • e315b5b - Metrics for server APIs (poll, execution, response) (#87)

Breaking Changes

Open Sourcing

Bug Fixes

Miscellaneous