Skip to content

Commit

Permalink
Patch to fix childWF decision panic after reset
Browse files Browse the repository at this point in the history
  • Loading branch information
longquanzheng committed Aug 14, 2021
1 parent 3b485bd commit 057125c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
7 changes: 6 additions & 1 deletion internal/internal_event_handlers.go
Expand Up @@ -374,7 +374,12 @@ func (wc *workflowEnvironmentImpl) RegisterCancelHandler(handler func()) {
func (wc *workflowEnvironmentImpl) ExecuteChildWorkflow(
params executeWorkflowParams, callback resultHandler, startedHandler func(r WorkflowExecution, e error)) error {
if params.workflowID == "" {
params.workflowID = wc.workflowInfo.WorkflowExecution.RunID + "_" + wc.GenerateSequenceID()
if wc.workflowInfo.OriginalRunId != ""{
params.workflowID = wc.workflowInfo.OriginalRunId + "_" + wc.GenerateSequenceID()
}else{
params.workflowID = wc.workflowInfo.WorkflowExecution.RunID + "_" + wc.GenerateSequenceID()
}

}
memo, err := getWorkflowMemo(params.memo, wc.dataConverter)
if err != nil {
Expand Down
1 change: 1 addition & 0 deletions internal/internal_task_handlers.go
Expand Up @@ -616,6 +616,7 @@ func (wth *workflowTaskHandlerImpl) createWorkflowContext(task *s.PollForDecisio
ID: workflowID,
RunID: runID,
},
OriginalRunId: attributes.GetOriginalExecutionRunId(),
WorkflowType: flowWorkflowTypeFrom(*task.WorkflowType),
TaskListName: taskList.GetName(),
ExecutionStartToCloseTimeoutSeconds: attributes.GetExecutionStartToCloseTimeoutSeconds(),
Expand Down
1 change: 1 addition & 0 deletions internal/workflow.go
Expand Up @@ -727,6 +727,7 @@ func getWorkflowHeader(ctx Context, ctxProps []ContextPropagator) *s.Header {
// WorkflowInfo information about currently executing workflow
type WorkflowInfo struct {
WorkflowExecution WorkflowExecution
OriginalRunId string //This is the runID when the WorkflowExecutionStarted event is written
WorkflowType WorkflowType
TaskListName string
ExecutionStartToCloseTimeoutSeconds int32
Expand Down

0 comments on commit 057125c

Please sign in to comment.