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

Improve error handling for SQL persistence implementation #4178

Merged
merged 1 commit into from
May 10, 2021

Conversation

Shaddoll
Copy link
Member

@Shaddoll Shaddoll commented May 6, 2021

What changed?
Convert sqlplugin specific errors to common errors, such as timeout error, service busy error, entity not exists error.

Why?
Common errors are used to emit metrics in persistence layer. Different error types correspond to different metric names.
Our Cassandra implementation converts the errors to common error types as well. And we can use common errors to more intelligently decide if the call should be retried or not.

How did you test it?

Potential risks

Release notes

Documentation Changes

@coveralls
Copy link

coveralls commented May 6, 2021

Pull Request Test Coverage Report for Build 54b5b6f1-a288-469f-b339-54bac3167a94

  • 52 of 255 (20.39%) changed or added relevant lines in 13 files are covered.
  • 39 unchanged lines in 8 files lost coverage.
  • Overall coverage increased (+0.1%) to 59.92%

Changes Missing Coverage Covered Lines Changed/Added Lines %
common/persistence/sql/sqlHistoryManager.go 0 3 0.0%
common/persistence/sql/sqlShardManager.go 1 4 25.0%
common/persistence/sql/sqlMetadataManagerV2.go 0 6 0.0%
common/persistence/sql/sqlplugin/mysql/db.go 29 35 82.86%
common/persistence/sql/workflowStateNonMaps.go 0 7 0.0%
common/persistence/sql/sqlTaskManager.go 0 10 0.0%
common/persistence/sql/sqlVisibilityStore.go 2 14 14.29%
common/persistence/sql/common.go 10 23 43.48%
common/persistence/sql/sqlplugin/postgres/db.go 4 18 22.22%
common/persistence/sql/workflowStateMaps.go 0 20 0.0%
Files with Coverage Reduction New Missed Lines %
host/signalworkflowTest.go 1 95.53%
common/persistence/sql/sqlVisibilityStore.go 2 60.0%
common/task/parallelTaskProcessor.go 2 92.48%
common/task/weightedRoundRobinTaskScheduler.go 2 88.6%
service/history/queue/timer_queue_processor_base.go 4 78.83%
common/task/fifoTaskScheduler.go 5 84.54%
service/history/queue/processor_base.go 7 61.82%
common/persistence/sql/sqlExecutionManager.go 16 58.26%
Totals Coverage Status
Change from base Build c4b8ceee-488f-41e5-b395-596a83a34026: 0.1%
Covered Lines: 88128
Relevant Lines: 147075

💛 - Coveralls

@Shaddoll Shaddoll merged commit 91f8828 into cadence-workflow:master May 10, 2021
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