-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Refactor connection pool #5081
Open
syeopite
wants to merge
9
commits into
iv-org:master
Choose a base branch
from
syeopite:connection-pool-improvements
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Refactor connection pool #5081
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Raises a wrapped exception on any DB:Error - Don't use a non-pool client when client fails - Ensure that client is always released
syeopite
requested review from
SamantazFox,
unixfox and
a team
as code owners
November 12, 2024 00:27
syeopite
commented
Nov 12, 2024
pool.checkout(&block) already ensures that the checked out item will be released back into the pool
TODO: Add connection pool stats to https://crystal-lang.github.io/crystal-db/api/0.13.1/DB/Pool.html#stats-instance-method |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Brings improvements from https://github.com/jgaskins/http_client which is a shard that implements a HTTP connection pool through
DB::Pool
like Invidious.The most noticeable change is that connection timeout errors will no longer say
DB::PoolTimeout
but ratherInvidious::ConnectionPool::Error
. Full backtrace here.Backtrace
I've also added a configuration option to customize max idle pool size and the checkout timeout