Skip to content

Commit

Permalink
Fix decision task leak with workflow timeout as ttl (#373)
Browse files Browse the repository at this point in the history
* Fix decision task leak with workflow timeout as ttl
  • Loading branch information
vancexu authored Oct 17, 2017
1 parent b388ca7 commit cbc769d
Show file tree
Hide file tree
Showing 20 changed files with 175 additions and 83 deletions.
4 changes: 2 additions & 2 deletions .gen/go/matching/idl.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

44 changes: 38 additions & 6 deletions .gen/go/matching/types.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,12 @@ Run all the tests:

```bash
make test

# or go to folder with *_test.go, e.g
cd service/history/
go test -v
# run single test
go test -v <path> -run <TestSuite> -testify.m <TestSpercificTaskName>
# example:
go test -v github.com/uber/cadence/common/persistence -run TestCassandraPersistenceSuite -testify.m TestPersistenceStartWorkflow
```
5 changes: 5 additions & 0 deletions common/persistence/cassandraPersistence.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ const (
`completion_event: ?, ` +
`task_list: ?, ` +
`workflow_type_name: ?, ` +
`workflow_timeout: ?, ` +
`decision_task_timeout: ?, ` +
`execution_context: ?, ` +
`state: ?, ` +
Expand Down Expand Up @@ -854,6 +855,7 @@ func (d *cassandraPersistence) CreateWorkflowExecutionWithinBatch(request *Creat
nil,
request.TaskList,
request.WorkflowTypeName,
request.WorkflowTimeout,
request.DecisionTimeoutValue,
request.ExecutionContext,
WorkflowStateCreated,
Expand Down Expand Up @@ -959,6 +961,7 @@ func (d *cassandraPersistence) UpdateWorkflowExecution(request *UpdateWorkflowEx
executionInfo.CompletionEvent,
executionInfo.TaskList,
executionInfo.WorkflowTypeName,
executionInfo.WorkflowTimeout,
executionInfo.DecisionTimeoutValue,
executionInfo.ExecutionContext,
executionInfo.State,
Expand Down Expand Up @@ -1882,6 +1885,8 @@ func createWorkflowExecutionInfo(result map[string]interface{}) *WorkflowExecuti
info.TaskList = v.(string)
case "workflow_type_name":
info.WorkflowTypeName = v.(string)
case "workflow_timeout":
info.WorkflowTimeout = int32(v.(int))
case "decision_task_timeout":
info.DecisionTimeoutValue = int32(v.(int))
case "execution_context":
Expand Down
Loading

0 comments on commit cbc769d

Please sign in to comment.