You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@zookeeper.apache.org by GitBox <gi...@apache.org> on 2022/05/04 17:08:12 UTC
[GitHub] [zookeeper] lfrancke commented on a diff in pull request #1674: ZOOKEEPER-4276: Support setupQuorumPeerConfig only with secureClientPort
lfrancke commented on code in PR #1674:
URL: https://github.com/apache/zookeeper/pull/1674#discussion_r865074958
##########
zookeeper-server/src/main/java/org/apache/zookeeper/server/quorum/QuorumPeerConfig.java:
##########
@@ -747,22 +747,32 @@ private void setupClientPort() throws ConfigException {
return;
}
QuorumServer qs = quorumVerifier.getAllMembers().get(serverId);
- if (clientPortAddress != null && qs != null && qs.clientAddr != null) {
- if ((!clientPortAddress.getAddress().isAnyLocalAddress() && !clientPortAddress.equals(qs.clientAddr)) || (
- clientPortAddress.getAddress().isAnyLocalAddress()
- && clientPortAddress.getPort() != qs.clientAddr.getPort())) {
- throw new ConfigException("client address for this server (id = " + serverId
- + ") in static config file is " + clientPortAddress
- + " is different from client address found in dynamic file: " + qs.clientAddr);
- }
+ if (qs == null) {
+ return;
}
- if (qs != null && qs.clientAddr != null) {
+ if (clientPortAddress == null && secureClientPortAddress == null && qs.clientAddr != null) {
clientPortAddress = qs.clientAddr;
+ return;
}
- if (qs != null && qs.clientAddr == null) {
+ if (qs.clientAddr == null && clientPortAddress != null) {
qs.clientAddr = clientPortAddress;
qs.isClientAddrFromStatic = true;
+ return;
+ }
+ if (clientPortAddress != null
Review Comment:
I have to admit: I have no idea what or why you're checking this here.
Why are you bailing out here?
I think some clarifying comment would be helpful for these two if-statements.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@zookeeper.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org