-
Notifications
You must be signed in to change notification settings - Fork 812
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bugfix: parent workflow, when signaling child workflow, can experienc… #607
Conversation
…e deadlock, if child workflow, at the same time, is completed.
@@ -328,26 +328,26 @@ func (t *transferQueueProcessorImpl) processActivityTask(task *persistence.Trans | |||
if err != nil { | |||
return err | |||
} | |||
defer release() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you immediate call 'defer release()' after acquiring the release object?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there can be cases when cache is full and context, release being nil, while err not being nil, doing defer release() before error checking can lead to null pointer issue
|
||
release() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a comment on why calling the release here is important.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure
workflowTypeName := msBuilder.executionInfo.WorkflowTypeName | ||
workflowStartTimestamp := msBuilder.executionInfo.StartTimestamp.UnixNano() | ||
workflowCloseTimestamp := msBuilder.getLastUpdatedTimestamp() | ||
workflowStatue := getWorkflowExecutionCloseStatus(msBuilder.executionInfo.CloseStatus) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: typo
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
@@ -455,16 +456,30 @@ func (t *transferQueueProcessorImpl) processCloseExecution(task *persistence.Tra | |||
return err | |||
} | |||
|
|||
isChildWorkflow := msBuilder.hasParentExecution() | |||
workflowCloseStatus := msBuilder.executionInfo.CloseStatus | |||
completionEvent, _ := msBuilder.GetCompletionEvent() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We will unnecessarily deserialize the completionEvent even for execution which does not have a Parent. Can you bring this back with the If check?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure
…e deadlock, if child workflow, at the same time, is completed.