Coder Social home page Coder Social logo

uber-go / cadence-client Goto Github PK

View Code? Open in Web Editor NEW
336.0 29.0 127.0 8.74 MB

Framework for authoring workflows and activities running on top of the Cadence orchestration engine.

Home Page: https://cadenceworkflow.io

License: MIT License

Makefile 0.76% Go 99.07% Shell 0.13% Dockerfile 0.04%
golang cadence authoring-workflows orchestration-engine workflow-functions task-management task-queue aws-swf

cadence-client's People

Contributors

agautam478 avatar alexshtin avatar andrewjdawson2016 avatar arthurgan avatar demirkayaender avatar dmetzgar avatar groxx avatar jakobht avatar lihannan99 avatar longquanzheng avatar madhuravi avatar meiliang86 avatar mfateev avatar mindaugasbarcauskas avatar mkolodezny avatar samarabbas avatar seriousben avatar sevein avatar shijiesheng avatar shreyassrivatsan avatar sivakku avatar taylanisikdemir avatar timl3136 avatar vancexu avatar venkat1109 avatar vytautas-karpavicius avatar wxing1292 avatar yiminc avatar yiminc-zz avatar yycptt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cadence-client's Issues

Workflow code update by using activity results from the previous execution

In a lot of cases workflow changes do not affect activity invocations much. In this case the workflow code upgrade could use existing history not for replay but as a "cache" of activity results. This way after upgrade the workflow executes from the beginning, but uses activity results for immediate activity execution.

Fix flaky unit test: TestWorkflowTask_NondeterministicDetection

=== RUN TestWorkflowTask_NondeterministicDetection
2017-05-16T17:10:59.322Z DEBUG _obj_test/internal_task_handlers.go:299 Processing new workflow task. {"WorkflowType": "testWorkflow", "WorkflowID": "fake-workflow-id", "RunID": "fake-run-id", "PreviousStartedEventId": 2}
2017-05-16T17:10:59.323Z ERROR _obj_test/internal_task_handlers.go:391 Replay and history mismatch. {"error": "nondeterministic workflow: history event is ActivityTaskScheduled: (ActivityId:0, ActivityType:(Name:some_random_activity), TaskList:(Name:taskList), Input:[len=0]), replay decision is ScheduleActivityTask: (ActivityId:0, ActivityType:(Name:Greeter_Activity), TaskList:(Name:taskList), Input:[len=0], ScheduleToCloseTimeoutSeconds:0, ScheduleToStartTimeoutSeconds:0, StartToCloseTimeoutSeconds:0, HeartbeatTimeoutSeconds:0)"}
github.com/uber-go/cadence-client/vendor/go.uber.org/zap.Stack
/home/travis/gopath/src/github.com/uber-go/cadence-client/vendor/go.uber.org/zap/field.go:209
github.com/uber-go/cadence-client/vendor/go.uber.org/zap.(*Logger).check
/home/travis/gopath/src/github.com/uber-go/cadence-client/vendor/go.uber.org/zap/logger.go:273
github.com/uber-go/cadence-client/vendor/go.uber.org/zap.(*Logger).Error
/home/travis/gopath/src/github.com/uber-go/cadence-client/vendor/go.uber.org/zap/logger.go:176
github.com/uber-go/cadence-client/client/cadence.(*workflowTaskHandlerImpl).ProcessWorkflowTask
github.com/uber-go/cadence-client/client/cadence/_test/_obj_test/internal_task_handlers.go:391
github.com/uber-go/cadence-client/client/cadence.(*TaskHandlersTestSuite).TestWorkflowTask_NondeterministicDetection
/home/travis/gopath/src/github.com/uber-go/cadence-client/client/cadence/internal_task_handlers_test.go:189
runtime.call32
/home/travis/.gimme/versions/go1.8.linux.amd64/src/runtime/asm_amd64.s:514
reflect.Value.call
/home/travis/.gimme/versions/go1.8.linux.amd64/src/reflect/value.go:434
reflect.Value.Call
/home/travis/.gimme/versions/go1.8.linux.amd64/src/reflect/value.go:302
github.com/uber-go/cadence-client/vendor/github.com/stretchr/testify/suite.Run.func2
/home/travis/gopath/src/github.com/uber-go/cadence-client/vendor/github.com/stretchr/testify/suite/suite.go:101
testing.tRunner
/home/travis/.gimme/versions/go1.8.linux.amd64/src/testing/testing.go:657

Support storing intermediate results in object store

Today, cadence cannot support use-cases where intermediary steps can generate large amounts of data as results. The scaling limitation for this is the size of the history. One idea would be for the client to upload the intermediate results in an object store (ex-S3) and just use the url in the history. This task is to track support for this feature.

Result encoding bug

if activity's result type is a pointer, when it returns nil, then the result encoding will panic.
Example:
type myData struct{}
func testActivity(ctx context.Context) (*myData, error) {
return nil, errors.New("test-error")
}
when the encoding framework try to encode the nil pointer, it will panic.

remove our testify mock copy

The much needed changes for testify mock has been merged (with slightly changes). We should remove our copy of testify mock and use the official version, with slightly change (panic handler) to the mock calls on our call sites.

error handling

When there is error happen in activity and it returns error, that error will be wrapped as ErrorWithDetails and pass to user's decider code. When user get this ErrorWithDetails, they don't know what type the error details is. Today, they could rely on the Reason which is a string, and compare that string to decide what type of error it is. However, the string could have collision, potentially.

We need to decide if current solution (rely on string matching) is fine, or we want to have something more complicated, for example adding error code to the error.

sleep facility for activities

We need a sleep API that would sleep on real clock in normal case, but sleep on mock clock in unit test environment, something like:
cadence.ActivitySleep(ctx context.Context, d time.Duration)
then, in activity code, instead of:
time.Sleep(d)
it should do:
cadence.ActivitySleep(ctx, d)
this way, ActivitySleep would sleep on real clock in normal case, but sleep on mock clock on unit tests.

unit test: mock activity sleep on workflow clock

when user mock an activity, we need a way for user to say that the mocked activity would sleep/delay a certain amount of time on workflow clock.
The code would looks something like:
env := testSuite.NewTestWorkflowEnvironment()
env.OnActivity(myActivity, mock.Anything).After(time.Hour).return(mockValues...)

For the above code to work, it needs our PR to testify get merged. If not, then the code would looks like:
waitCh := env.After(time.Hour)
env.OnActivity(myActivity, mock.Anything).WaitUntil(waitCh).return(mockValues...)

reorganize internal code

we could use Go's internal package support to move internal code into separate internal package so it is more clear to users on public APIs.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.