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
Expose method to warm connection pool from JedisPool #1828 #2064
Closed
tmack8001
wants to merge
8
commits into
redis:master
from
tmack8001:tmack/gh-1828-warm-internal-pool
Closed
Expose method to warm connection pool from JedisPool #1828 #2064
tmack8001
wants to merge
8
commits into
redis:master
from
tmack8001:tmack/gh-1828-warm-internal-pool
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
tmack8001
force-pushed
the
tmack/gh-1828-warm-internal-pool
branch
from
September 18, 2019 16:12
34109fd
to
5899863
Compare
tmack8001
changed the title
Expose method to warm connection pool from JedisPool gh-1828
Expose method to warm connection pool from JedisPool #1828
Sep 18, 2019
Not sure of the failure, but will try to investigate why the following test failed.
|
sazzad16
requested changes
Oct 27, 2019
tmack8001
force-pushed
the
tmack/gh-1828-warm-internal-pool
branch
from
February 19, 2020 16:16
8cf4ab6
to
7640c3b
Compare
sazzad16
requested changes
Feb 19, 2020
sazzad16
reviewed
Mar 14, 2020
gkorland
suggested changes
Mar 15, 2020
sazzad16
reviewed
Mar 15, 2020
sazzad16
previously approved these changes
Mar 15, 2020
gkorland
reviewed
Dec 6, 2020
public void prepareInternalPool() { | ||
try { | ||
this.internalPool.preparePool(); | ||
} catch (Exception e) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are we hiding the exception and not throwing it back to the client?
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.
I decided to expose a public method on the
AbstractJedisPool
to allow users to then explicitly warm theirJedisPool
after creation instead of adding yet another parameter to the already overwritten set of constructors for theJedisPool
. This method wraps the call to the internal pool catching exceptions and logging the underlying error that occurred.Example usage would be the following:
The logic within preparePool is standard within the
GenericObjectPool
implementation to make sure that there is always a minimum ofminIdle
connections available within the pool. This helps in high throughput applications as then the cost of creating connections are done before hand vs upon demand/use.