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

fix: add connection timeout for db conn pool #1032

Merged
merged 3 commits into from
Dec 11, 2023

Conversation

cch123
Copy link
Contributor

@cch123 cch123 commented Dec 8, 2023

Purpose or design rationale of this PR

Database conn pool should specify strategy for conn timeout

  1. for idle connections, should shrink the pool to save more resources
  2. for connections, if network partition or LB switch happened, the original conns will die, but app will not know this until the code runs to reading/writing on this conn. There should be a way to evict the expired conn. if there is a dbproxy between app and mysql, this max lifetime should be less than the proxy config.

These two params should also considered under your db architecture~

Deployment tag versioning

Has tag in common/version.go been updated or have you added bump-version label to this PR?

  • No, this PR doesn't involve a new deployment, git tag, docker image tag
  • Yes

Breaking change label

Does this PR have the breaking-change label?

  • No, this PR is not a breaking change
  • Yes

georgehao
georgehao previously approved these changes Dec 8, 2023
@georgehao georgehao changed the title fix: add connection timeout for mysql conn pool fix: add connection timeout for db conn pool Dec 8, 2023
Copy link

codecov bot commented Dec 8, 2023

Codecov Report

Attention: 2 lines in your changes are missing coverage. Please review.

Comparison is base (bc5ec89) 48.03% compared to head (3dcea12) 48.04%.

Files Patch % Lines
bridge-history-api/utils/database.go 0.00% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #1032   +/-   ##
========================================
  Coverage    48.03%   48.04%           
========================================
  Files          101      101           
  Lines        10692    10697    +5     
========================================
+ Hits          5136     5139    +3     
- Misses        5126     5128    +2     
  Partials       430      430           
Flag Coverage Δ
bridge-history-api 11.11% <0.00%> (-0.02%) ⬇️
common 55.05% <100.00%> (+0.11%) ⬆️
coordinator 18.91% <ø> (ø)
database 42.85% <ø> (ø)
rollup 66.00% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@0xmountaintop 0xmountaintop added the bump-version Bump the version tag for deployment label Dec 11, 2023
@0xmountaintop 0xmountaintop merged commit 2e627f7 into scroll-tech:develop Dec 11, 2023
22 of 23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bump-version Bump the version tag for deployment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants