uber / cadence

Cadence is a distributed, scalable, durable, and highly available orchestration engine to execute asynchronous long-running business logic in a scalable and resilient way.
https://cadenceworkflow.io
MIT License
7.96k stars 772 forks source link

Fix replication metric emitter shutdown #6117

Closed taylanisikdemir closed 3 weeks ago

taylanisikdemir commented 3 weeks ago

What changed?

MetricEmitterImpl was not waiting for underlying goroutine to finish before returning on Stop().

Why? Stops should not leave goroutines behind.

codecov[bot] commented 3 weeks ago

Codecov Report

Attention: Patch coverage is 83.33333% with 2 lines in your changes missing coverage. Please review.

Project coverage is 71.03%. Comparing base (ce92cd8) to head (29e1c74). Report is 1 commits behind head on master.

Additional details and impacted files | [Files](https://app.codecov.io/gh/uber/cadence/pull/6117?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=uber) | Coverage Δ | | |---|---|---| | [service/history/replication/metrics\_emitter.go](https://app.codecov.io/gh/uber/cadence/pull/6117?src=pr&el=tree&filepath=service%2Fhistory%2Freplication%2Fmetrics_emitter.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=uber#diff-c2VydmljZS9oaXN0b3J5L3JlcGxpY2F0aW9uL21ldHJpY3NfZW1pdHRlci5nbw==) | `81.94% <83.33%> (+34.25%)` | :arrow_up: | ... and [8 files with indirect coverage changes](https://app.codecov.io/gh/uber/cadence/pull/6117/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=uber) ------ [Continue to review full report in Codecov by Sentry](https://app.codecov.io/gh/uber/cadence/pull/6117?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=uber). > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=uber) > `Δ = absolute (impact)`, `ø = not affected`, `? = missing data` > Powered by [Codecov](https://app.codecov.io/gh/uber/cadence/pull/6117?dropdown=coverage&src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=uber). Last update [ce92cd8...29e1c74](https://app.codecov.io/gh/uber/cadence/pull/6117?dropdown=coverage&src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=uber). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=uber).
coveralls commented 3 weeks ago

Pull Request Test Coverage Report for Build 018feaa2-8fc3-4a42-84aa-10bd2ac726ee

Details


Changes Missing Coverage Covered Lines Changed/Added Lines %
service/history/replication/metrics_emitter.go 12 14 85.71%
<!-- Total: 12 14 85.71% -->
Files with Coverage Reduction New Missed Lines %
common/types/shared.go 1 39.88%
common/cache/lru.go 2 93.01%
common/persistence/sql/sqlplugin/mysql/task.go 2 73.68%
service/history/replication/task_processor.go 2 82.76%
common/persistence/sql/sqlplugin/mysql/db.go 2 79.49%
common/persistence/historyManager.go 2 66.67%
service/history/handler/handler.go 3 96.2%
tools/cli/admin_db_decode_thrift.go 3 69.23%
common/persistence/statsComputer.go 3 98.21%
common/task/fifo_task_scheduler.go 5 82.47%
<!-- Total: 34 -->
Totals Coverage Status
Change from base Build 018fea84-767f-4b7b-b478-9c0ffa321880: 0.03%
Covered Lines: 105592
Relevant Lines: 148963

💛 - Coveralls