narendly commented on code in PR #2082:
URL: https://github.com/apache/helix/pull/2082#discussion_r870559369
##########
zookeeper-api/src/main/java/org/apache/helix/zookeeper/zkclient/ZkClient.java:
##########
@@ -1942,22 +1943,61 @@ public void asyncCreate(final String path, Object
datat, final CreateMode mode,
private void doAsyncCreate(final String path, final byte[] data, final
CreateMode mode,
final long startT, final ZkAsyncCallbacks.CreateCallbackHandler cb,
final String expectedSessionId) {
+ try {
+ retryUntilConnected(() -> {
+ getExpectedZookeeper(expectedSessionId)
+ .create(path, data, ZooDefs.Ids.OPEN_ACL_UNSAFE, mode,
+ (AsyncCallback.StringCallback) cb,
+ new ZkAsyncRetryCallContext(_asyncCallRetryThread, cb,
_monitor, startT, 0, false,
+ GZipCompressionUtil.isCompressed(data)) {
+ @Override
+ protected void doRetry() {
+ doAsyncCreate(path, data, mode,
System.currentTimeMillis(), cb,
+ expectedSessionId);
+ }
+ });
+ return null;
+ });
+ } catch (RuntimeException e) {
+ // Process callback to release caller from waiting
+ cb.processResult(KeeperException.Code.APIERROR.intValue(), path,
+ new ZkAsyncCallMonitorContext(_monitor, startT, 0, false), null);
+ throw e;
+ }
+ }
Review Comment:
Can we get rid of this `doAsyncCreate()` and just use the one with `ttl =
-1`? That's what the upstream ZK is doing anyway...
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]