jiajunwang commented on a change in pull request #642: Fix handleNewSession
creating ephemeral node with expired session
URL: https://github.com/apache/helix/pull/642#discussion_r361018724
##########
File path:
helix-core/src/main/java/org/apache/helix/manager/zk/zookeeper/ZkClient.java
##########
@@ -556,15 +644,55 @@ public String create(final String path, Object datat,
final List<ACL> acl, final
}
long startT = System.currentTimeMillis();
try {
- final byte[] data = datat == null ? null : serialize(datat, path);
- checkDataSizeLimit(data);
- String actualPath = retryUntilConnected(new Callable<String>() {
- @Override
- public String call() throws Exception {
- return getConnection().create(path, data, acl, mode);
+ final byte[] dataBytes = dataObject == null ? null :
serialize(dataObject, path);
+ checkDataSizeLimit(dataBytes);
+
+ /*
Review comment:
I feel it would be much cleaner if you split the session check and mode
check related logic to a separate method. All the comments could be much
simpler as well.
----------------------------------------------------------------
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]