Skip to content

Conversation

@fcb-xiaobo
Copy link
Contributor

Purpose of this pull request

close #8836

Does this PR introduce any user-facing change?

How was this patch tested?

Check list

Comment on lines 68 to 75
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);
}
Copy link
Member

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.

Copy link
Contributor Author

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

Copy link
Member

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.

Copy link
Contributor Author

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

@FuYouJ
Copy link
Contributor

FuYouJ commented Feb 26, 2025

LGTM

@fcb-xiaobo
Copy link
Contributor Author

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

image

image

https://redis.io/docs/latest/operate/oss_and_stack/reference/cluster-spec/
image

Copy link
Member

@liunaijie liunaijie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@hailin0 hailin0 merged commit e56f06c into apache:dev Feb 27, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Improve][Redis] Optimized Redis connection param

5 participants