-
Notifications
You must be signed in to change notification settings - Fork 2.2k
[Improve][Redis] Optimized Redis connection params #8841
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][Redis] Optimized Redis connection params #8841
Conversation
| if (config.getOptional(RedisBaseOptions.HOST).isPresent()) { | ||
| // set host | ||
| this.host = config.get(RedisBaseOptions.HOST); | ||
| } | ||
| if (config.getOptional(RedisBaseOptions.PORT).isPresent()) { | ||
| // set port | ||
| this.port = config.get(RedisBaseOptions.PORT); | ||
| } |
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.
The behavior before is same as this patch. Because when host or port not configured, config.get(RedisBaseOptions.HOST) will return null.
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.
The behavior before is same as this patch. Because when host or port not configured,
config.get(RedisBaseOptions.HOST)will return null.
Thank you for your review. I have tested locally that when the host and port are not configured, if the condition is judged as false, the situation you mentioned will not occur. Is that my understanding correct? However, I have discovered another issue that I will update and fix later
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.
I mean this part you changed the bahavior is same as before you change.
When host existed, get host value and set to this.host, when host not existed, the host value would set to null. So I think the change of this part is unnecessary.
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.
Okay, I understand what you mean. Thank you for your suggestion
|
LGTM |
|
During the testing process, I found an exception in the jedissWrapper. select (dbNum) method. I checked the official website and found that redisCluster does not support selecting db. If the select method is used, an error will be reported. Therefore, I believe this is a new issue. I will briefly raise an issue and try to fix it https://redis.io/docs/latest/operate/oss_and_stack/reference/cluster-spec/ |
liunaijie
left a comment
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.
LGTM



Purpose of this pull request
close #8836
Does this PR introduce any user-facing change?
How was this patch tested?
Check list
New License Guide
release-note.