Skip to content
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: request cancel info should be pass down to persistence layer, add functionality to allow workflow signal and cancellation to specify target child workflow only #544

Merged
merged 7 commits into from
Feb 16, 2018

Conversation

wxing1292
Copy link
Contributor

@wxing1292 wxing1292 commented Feb 6, 2018

bugfix: request cancel info should be pass down to persistence layer
make transferTaskTypeTransferTargetRunID used in persistence layer only
enable cancel current workflow decision

client side change: cadence-workflow/cadence-go-client#401

solve #512

@wxing1292 wxing1292 requested a review from samarabbas February 6, 2018 18:56
@coveralls
Copy link

coveralls commented Feb 6, 2018

Coverage Status

Coverage decreased (-0.04%) to 68.441% when pulling 4a2609a on cancellation into 24b89d9 on master.

@wxing1292 wxing1292 requested a review from madhuravi February 6, 2018 23:45
@wxing1292 wxing1292 force-pushed the cancellation branch 3 times, most recently from 654bf89 to 48b7d50 Compare February 10, 2018 09:20
@wxing1292 wxing1292 changed the title bugfix: request cancel info should be pass down to persistence layer bugfix: request cancel info should be pass down to persistence layer, add functionality to allow workflow signal and cancellation to specify target child workflow only Feb 10, 2018
@wxing1292 wxing1292 force-pushed the cancellation branch 4 times, most recently from 5cc6d26 to 8b4ff93 Compare February 11, 2018 01:57
bugfix: cancel workflow control is not used
add functionality to allow workflow signal and cancellation to specify target child workflow only
@@ -550,6 +553,7 @@ struct ExternalWorkflowExecutionCancelRequestedEventAttributes {
10: optional i64 (js.type = "Long") initiatedEventId
20: optional string domain
30: optional WorkflowExecution workflowExecution
40: optional binary control
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we need control here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

because we cannot use the workflow ID as unique identifier for workflow cancellation.
so, we must come up with a "ID", and control is the ID.
the reason i use "binary control" instead of "int64 id" is to follow the existing pattern

@@ -919,6 +924,7 @@ struct RequestCancelWorkflowExecutionRequest {
20: optional WorkflowExecution workflowExecution
30: optional string identity
40: optional string requestId
50: optional binary control
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see above

@@ -0,0 +1,9 @@
{
"CurrVersion": "0.6",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

version 0.5 is not released yet. Can you have this schema change as part of 0.5?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

version 0.5 is used specifically for cross DC testing. and 0.5 binary is deployed to 1 host.

@@ -659,17 +659,18 @@ func (b *historyBuilder) newRequestCancelExternalWorkflowExecutionInitiatedEvent
attributes.DecisionTaskCompletedEventId = common.Int64Ptr(decisionTaskCompletedEventID)
attributes.Domain = common.StringPtr(*request.Domain)
attributes.WorkflowExecution = &workflow.WorkflowExecution{
WorkflowId: common.StringPtr(*request.WorkflowId),
RunId: common.StringPtr(*request.RunId),
WorkflowId: common.StringPtr(request.GetWorkflowId()),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just assign the pointer directly. No need to dereference.
WorkflowId: request.WorkflowId

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

@@ -978,11 +981,10 @@ Update_History_Loop:
break Process_Decision_Loop
}

foreignDomainEntry, err := e.domainCache.GetDomain(*attributes.Domain)
foreignDomainEntry, err := e.domainCache.GetDomain(attributes.GetDomain())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should treat domain on attributes as optional and use the current domain if one is not provided.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

@@ -229,6 +229,14 @@ func (t *transferQueueProcessorImpl) processTransferTasks(tasksCh chan<- *persis
return
}

// here we may have a serious bug
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment seems little misleading. Let's talk about this tomorrow.

@wxing1292 wxing1292 self-assigned this Feb 16, 2018
@wxing1292 wxing1292 merged commit ce52993 into master Feb 16, 2018
@wxing1292 wxing1292 deleted the cancellation branch February 16, 2018 21:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants