-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Add ability to reset password in JedisFactory for JedisPool and JedisSentinelPool #2314
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
Changes from all commits
e4877e9
0cbcf45
e1e40c5
1de4e0f
ce6f7db
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -175,6 +175,27 @@ public JedisSentinelPool(String masterName, Set<String> sentinels, | |
initPool(master); | ||
} | ||
|
||
public JedisSentinelPool(String masterName, Set<String> sentinels, final GenericObjectPoolConfig poolConfig, final JedisFactory factory) { | ||
this.poolConfig = poolConfig; | ||
this.connectionTimeout = Protocol.DEFAULT_TIMEOUT; | ||
this.soTimeout = Protocol.DEFAULT_TIMEOUT; | ||
this.infiniteSoTimeout = 0; | ||
this.user = null; | ||
this.password = null; | ||
this.database = Protocol.DEFAULT_DATABASE; | ||
this.clientName = null; | ||
this.sentinelConnectionTimeout = Protocol.DEFAULT_TIMEOUT; | ||
this.sentinelSoTimeout = Protocol.DEFAULT_TIMEOUT; | ||
this.sentinelUser = null; | ||
this.sentinelPassword = null; | ||
this.sentinelClientName = null; | ||
this.factory = factory; | ||
|
||
HostAndPort master = initSentinels(sentinels, masterName); | ||
initPool(poolConfig, factory); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @sazzad16 perhaps I get it wrong, but do you need to call initPool twice? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @gkorland There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please at least leave a comment in the code explaining this double call. |
||
initPool(master); | ||
} | ||
|
||
@Override | ||
public void destroy() { | ||
for (MasterListener m : masterListeners) { | ||
|
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.
@sazzad16 why do we force same user?
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.
@gkorland In redis-cli on Redis ACL, after doing
AUTH user pass
once, if we want toAUTH
again, we have to doAUTH user newpass
not justAUTH newpass
. I tried to imitate that here.I also thought, this would help to us to avoid any mistaken password change as a wrong password (but a valid one for other user) would break the whole pool.
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.
Please add a JavaDoc explaining it