Skip to content

Commit

Permalink
add handling of child workflow ID reuse logic (#500)
Browse files Browse the repository at this point in the history
  • Loading branch information
wxing1292 authored Jan 12, 2018
1 parent 5121974 commit b98524b
Show file tree
Hide file tree
Showing 5 changed files with 117 additions and 41 deletions.
2 changes: 1 addition & 1 deletion .gen/go/shared/idl.go

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

150 changes: 111 additions & 39 deletions .gen/go/shared/types.go

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

2 changes: 2 additions & 0 deletions idl/github.com/uber/cadence/shared.thrift
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,7 @@ struct StartChildWorkflowExecutionDecisionAttributes {
70: optional i32 taskStartToCloseTimeoutSeconds
80: optional ChildPolicy childPolicy
90: optional binary control
100: optional WorkflowIdReusePolicy workflowIdReusePolicy
}

struct Decision {
Expand Down Expand Up @@ -538,6 +539,7 @@ struct StartChildWorkflowExecutionInitiatedEventAttributes {
80: optional ChildPolicy childPolicy
90: optional binary control
100: optional i64 (js.type = "Long") decisionTaskCompletedEventId
110: optional WorkflowIdReusePolicy workflowIdReusePolicy
}

struct StartChildWorkflowExecutionFailedEventAttributes {
Expand Down
1 change: 1 addition & 0 deletions service/history/historyBuilder.go
Original file line number Diff line number Diff line change
Expand Up @@ -707,6 +707,7 @@ func (b *historyBuilder) newStartChildWorkflowExecutionInitiatedEvent(decisionTa
attributes.ChildPolicy = common.ChildPolicyPtr(*startAttributes.ChildPolicy)
attributes.Control = startAttributes.Control
attributes.DecisionTaskCompletedEventId = common.Int64Ptr(decisionTaskCompletedEventID)
attributes.WorkflowIdReusePolicy = startAttributes.WorkflowIdReusePolicy
historyEvent.StartChildWorkflowExecutionInitiatedEventAttributes = attributes

return historyEvent
Expand Down
3 changes: 2 additions & 1 deletion service/history/transferQueueProcessor.go
Original file line number Diff line number Diff line change
Expand Up @@ -634,7 +634,8 @@ func (t *transferQueueProcessorImpl) processStartChildExecution(task *persistenc
ExecutionStartToCloseTimeoutSeconds: common.Int32Ptr(*attributes.ExecutionStartToCloseTimeoutSeconds),
TaskStartToCloseTimeoutSeconds: common.Int32Ptr(*attributes.TaskStartToCloseTimeoutSeconds),
// Use the same request ID to dedupe StartWorkflowExecution calls
RequestId: common.StringPtr(ci.CreateRequestID),
RequestId: common.StringPtr(ci.CreateRequestID),
WorkflowIdReusePolicy: attributes.WorkflowIdReusePolicy,
},
ParentExecutionInfo: &history.ParentExecutionInfo{
DomainUUID: common.StringPtr(domainID),
Expand Down

0 comments on commit b98524b

Please sign in to comment.