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

Update generating close event to use event version #4261

Merged
merged 3 commits into from
Jun 8, 2021

Conversation

yux0
Copy link
Contributor

@yux0 yux0 commented Jun 8, 2021

What changed?
Update generating close event to use event version

Why?
The task refresher may generate a task with newer version and gets ignored later

How did you test it?
Unit tests.

Potential risks
If there is bugs with this change, there could be race condition in handling closed event

Release notes

Documentation Changes

@yux0 yux0 requested review from yycptt, emrahs and a team June 8, 2021 21:23
return taskGenerator.GenerateWorkflowCloseTasks(
now,
closeEvent,
Copy link
Contributor

Choose a reason for hiding this comment

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

it's possible that the closeEvent returned is nil even when error is nil right? then it will cause a NPE in taskGenerator?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will return error when close event is nil

) (*types.HistoryEvent, error) {

if e.GetExecutionInfo().CloseStatus == persistence.WorkflowCloseStatusNone {
return nil, nil
Copy link
Contributor

Choose a reason for hiding this comment

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

not sure if it's better to return an error here. Usually caller will assume historyEvent is not nil when error is nil?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will return error when close event is nil

@coveralls
Copy link

coveralls commented Jun 8, 2021

Pull Request Test Coverage Report for Build 8722b8b3-2c20-498e-a055-fd9ded3e3c9a

  • 33 of 40 (82.5%) changed or added relevant lines in 3 files are covered.
  • 151 unchanged lines in 16 files lost coverage.
  • Overall coverage decreased (-0.06%) to 60.198%

Changes Missing Coverage Covered Lines Changed/Added Lines %
service/history/execution/mutable_state_builder.go 27 29 93.1%
service/history/execution/mutable_state_task_refresher.go 0 5 0.0%
Files with Coverage Reduction New Missed Lines %
client/history/client.go 2 44.78%
client/history/metricClient.go 2 49.43%
common/task/weightedRoundRobinTaskScheduler.go 2 89.12%
service/history/handler.go 2 46.67%
common/persistence/cassandra/cassandraPersistence.go 3 54.09%
common/task/fifoTaskScheduler.go 4 83.51%
service/frontend/workflowHandler.go 4 58.35%
service/history/execution/mutable_state_builder.go 4 69.96%
service/history/task/transfer_standby_task_executor.go 4 90.42%
service/history/execution/context.go 6 68.39%
Totals Coverage Status
Change from base Build 39e98bd7-37bf-44fb-8f59-472525485e5c: -0.06%
Covered Lines: 88836
Relevant Lines: 147574

💛 - Coveralls

@yux0 yux0 merged commit ea912b0 into uber:master Jun 8, 2021
@yux0 yux0 deleted the close_event_version branch June 8, 2021 23:08
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