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

Get rid of mutex in matching/liveness and reduce test duration #5917

Conversation

taylanisikdemir
Copy link
Member

What changed?

  • Replaced mutex with atomic
  • Updated Stop() to wait for background goroutine completion
  • Added a new log to distinguish between regular tasklist stop vs liveness originated tasklist stop
  • Removed time argument from markAlive because only time.Now is passed
  • Reduced test duration from 8 sec to 2s

Why?
Just applying some best practices to improve things step by step.

How did you test it?

go test -timeout 60s -run ^TestLivenessSuite$ github.com/uber/cadence/service/matching -count=100 -v -race

Copy link

codecov bot commented Apr 17, 2024

Codecov Report

Merging #5917 (b0b842b) into master (e98ce90) will decrease coverage by 0.27%.
The diff coverage is 96.55%.

❗ Current head b0b842b differs from pull request most recent head 46e2707. Consider uploading reports for the commit 46e2707 to get more accurate results

Additional details and impacted files
Files Coverage Δ
service/matching/taskListManager.go 72.31% <100.00%> (+0.36%) ⬆️
service/matching/liveness.go 94.59% <95.45%> (-0.86%) ⬇️

... and 13 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 e98ce90...46e2707. Read the comment docs.

@coveralls
Copy link

coveralls commented Apr 17, 2024

Pull Request Test Coverage Report for Build 018ef271-caca-4f0c-bb43-d164077df25c

Details

  • 29 of 29 (100.0%) changed or added relevant lines in 2 files are covered.
  • 41 unchanged lines in 9 files lost coverage.
  • Overall coverage decreased (-0.003%) to 67.539%

Files with Coverage Reduction New Missed Lines %
service/history/queue/timer_queue_processor_base.go 1 77.62%
service/matching/liveness.go 1 95.56%
common/task/weighted_round_robin_task_scheduler.go 2 88.56%
common/task/fifo_task_scheduler.go 2 87.63%
service/history/execution/mutable_state_util.go 2 78.52%
common/persistence/historyManager.go 2 66.67%
service/history/queue/timer_gate.go 3 95.83%
service/matching/taskListManager.go 4 79.9%
service/history/execution/mutable_state_task_refresher.go 24 57.28%
Totals Coverage Status
Change from base Build 018ef25f-2676-4198-8971-594ae20e6cd1: -0.003%
Covered Lines: 98857
Relevant Lines: 146371

💛 - Coveralls

@taylanisikdemir taylanisikdemir force-pushed the taylan/matching_liveness_improvements branch from b0b842b to 46e2707 Compare April 18, 2024 18:22
@taylanisikdemir taylanisikdemir enabled auto-merge (squash) April 18, 2024 18:22
@taylanisikdemir taylanisikdemir merged commit 1620509 into cadence-workflow:master Apr 18, 2024
18 checks passed
@taylanisikdemir taylanisikdemir deleted the taylan/matching_liveness_improvements branch April 18, 2024 19:16
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