pkuwm commented on a change in pull request #642: Fix zk session race condition
before creating a live instance
URL: https://github.com/apache/helix/pull/642#discussion_r353333939
##########
File path:
helix-core/src/main/java/org/apache/helix/manager/zk/zookeeper/ZkClient.java
##########
@@ -521,6 +543,11 @@ public String create(final String path, Object data,
final CreateMode mode)
*/
public String create(final String path, Object datat, final List<ACL> acl,
final CreateMode mode)
throws IllegalArgumentException, ZkException {
+ return create(path, datat, acl, mode, null);
+ }
+
+ private String create(final String path, Object datat, final List<ACL> acl,
final CreateMode mode,
+ final String sessionId) throws IllegalArgumentException, ZkException {
Review comment:
Right, I had the same idea. On the other side, I realized that we had
metrics recording later in create() and retryUntilConnected(). If we check
session id earlier, that means createEphemeral fails and we also need to record
metrics. Thus adds more code to this early checking block. At the same time, I
didn't think checking in retryUntilConnected() takes significant overhead (it
will create a callable object, of course). So I decided not to do early check.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]