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

Fix SignalWithStartWorkflow Api #5671

Merged
merged 2 commits into from
Feb 22, 2024

Conversation

Shaddoll
Copy link
Member

What changed?
Store request ID to mutable state when handling signalwithstart request

Why?
To make SignalWithStartWorkflow idempotent

How did you test it?
manual test

Potential risks

Release notes

Documentation Changes

@coveralls
Copy link

coveralls commented Feb 17, 2024

Pull Request Test Coverage Report for Build 018dd21e-5b88-4d12-91ee-7c05d5340b28

Details

  • 0 of 3 (100.0%) changed or added relevant lines in 1 file are covered.
  • 78 unchanged lines in 9 files lost coverage.
  • Overall coverage increased (+0.04%) to 62.811%

Files with Coverage Reduction New Missed Lines %
common/task/weighted_round_robin_task_scheduler.go 2 89.05%
service/matching/taskListManager.go 2 80.2%
service/matching/taskReader.go 2 84.88%
common/task/fifo_task_scheduler.go 3 84.54%
service/history/task/transfer_standby_task_executor.go 4 87.84%
common/persistence/nosql/nosqlplugin/cassandra/workflow.go 6 59.1%
common/persistence/statsComputer.go 6 93.57%
service/history/execution/mutable_state_task_refresher.go 14 67.09%
common/persistence/nosql/nosqlplugin/cassandra/workflow_parsing_utils.go 39 79.13%
Totals Coverage Status
Change from base Build 018dd205-a759-4af3-ab4f-4bbae07e5903: 0.04%
Covered Lines: 92837
Relevant Lines: 147803

💛 - Coveralls

@@ -2584,6 +2584,10 @@ func (e *historyEngineImpl) SignalWithStartWorkflowExecution(
return nil, workflow.ErrSignalsLimitExceeded
}

if requestID := sRequest.GetRequestID(); requestID != "" {
Copy link
Member

Choose a reason for hiding this comment

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

How did you notice this was missing? It's a little bit unclear to me what are the side effects of doing this here. There's already AddWorkflowExecutionSignaled below, do these get deduped somehow?
It would be great if we take this opportunity to add some extra documentation/diagram for SignalWithStart flow.

Copy link
Member Author

Choose a reason for hiding this comment

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

I tested it locally and found it's not idempotent in this case.

@Shaddoll Shaddoll enabled auto-merge (squash) February 22, 2024 18:40
@Shaddoll Shaddoll merged commit 2965d81 into cadence-workflow:master Feb 22, 2024
17 checks passed
@@ -2584,6 +2584,10 @@ func (e *historyEngineImpl) SignalWithStartWorkflowExecution(
return nil, workflow.ErrSignalsLimitExceeded
}

if requestID := sRequest.GetRequestID(); requestID != "" {
Copy link
Member

Choose a reason for hiding this comment

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

I mean, pretty amazingly big fix, nice find. Is this flow covered with a unit-test? If they're not, I think we ought to probably cover all write (+query) APIs to ensure they're idempotent

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.

4 participants