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

Replication task processor shutdown improvements and start/stop unit tests #5996

Conversation

taylanisikdemir
Copy link
Member

What changed?
Replication task processor was not waiting for underlying goroutines when stopped. Added a waitgroup to fix that and validated with a unit test using goleak.VerifyNone

Also added similar leak check in history engine's start/stop test.

Why?
Improve shutdowns and code coverage

How did you test it?
unit test

@coveralls
Copy link

Pull Request Test Coverage Report for Build 018f5bab-298d-44df-b8e1-67f02e0ff1df

Details

  • 19 of 20 (95.0%) changed or added relevant lines in 1 file are covered.
  • 83 unchanged lines in 12 files lost coverage.
  • Overall coverage decreased (-0.02%) to 68.676%

Changes Missing Coverage Covered Lines Changed/Added Lines %
service/history/replication/task_processor.go 19 20 95.0%
Files with Coverage Reduction New Missed Lines %
service/history/queue/timer_queue_processor_base.go 1 77.66%
service/matching/taskReader.go 2 84.88%
common/persistence/execution_manager.go 2 83.74%
common/util.go 2 91.78%
service/history/execution/mutable_state_builder.go 2 71.29%
common/persistence/statsComputer.go 2 96.07%
service/history/task/task.go 3 84.81%
common/task/fifo_task_scheduler.go 3 84.54%
service/history/task/timer_active_task_executor.go 3 79.33%
service/history/task/fetcher.go 4 85.05%
Totals Coverage Status
Change from base Build 018f5aff-b7c8-4ac8-9e0c-a14d52f0ae0a: -0.02%
Covered Lines: 100889
Relevant Lines: 146905

💛 - Coveralls

Copy link

codecov bot commented May 9, 2024

Codecov Report

Attention: Patch coverage is 71.42857% with 4 lines in your changes are missing coverage. Please review.

Project coverage is 65.98%. Comparing base (b4a1f04) to head (577782d).

Additional details and impacted files
Files Coverage Δ
service/history/replication/task_processor.go 46.71% <71.42%> (+9.12%) ⬆️

... and 4 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b4a1f04...577782d. Read the comment docs.

Comment on lines +200 to +207
case p.requestChan <- &request{
token: &types.ReplicationToken{
ShardID: int32(p.shard.GetShardID()),
LastRetrievedMessageID: p.lastRetrievedMessageID,
LastProcessedMessageID: p.lastProcessedMessageID,
},
respChan: respChan,
}:
Copy link
Member Author

Choose a reason for hiding this comment

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

previously this was done inside sendFetchMessageRequest which was not checking p.done and blocking shutdowns

@taylanisikdemir taylanisikdemir merged commit 2fef3c3 into cadence-workflow:master May 9, 2024
20 checks passed
@taylanisikdemir taylanisikdemir deleted the taylan/history_leak_test branch May 9, 2024 18:13
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