jiajunwang commented on a change in pull request #970:
URL: https://github.com/apache/helix/pull/970#discussion_r417507520
##########
File path:
zookeeper-api/src/main/java/org/apache/helix/zookeeper/zkclient/ZkClient.java
##########
@@ -1758,50 +1776,66 @@ public void asyncSetData(final String path, Object
datat, final int version,
data = serialize(datat, path);
} catch (ZkMarshallingError e) {
cb.processResult(KeeperException.Code.MARSHALLINGERROR.intValue(), path,
- new ZkAsyncCallbacks.ZkAsyncCallContext(_monitor, startT, 0, false),
null);
+ new ZkAsyncCallMonitorContext(_monitor, startT, 0, false), null);
return;
}
+ doAsyncSetData(path, data, version, startT, cb);
+ }
+
+ private void doAsyncSetData(final String path, byte[] data, final int
version, final long startT,
+ final ZkAsyncCallbacks.SetDataCallbackHandler cb) {
retryUntilConnected(() -> {
((ZkConnection) getConnection()).getZookeeper().setData(path, data,
version, cb,
- new ZkAsyncCallbacks.ZkAsyncCallContext(_monitor, startT,
- data == null ? 0 : data.length, false));
+ new ZkAsyncRetryCallContext(_asyncCallRetryThread, cb, _monitor,
startT,
+ data == null ? 0 : data.length, false) {
+ @Override
+ protected void doRetry() {
+ doAsyncSetData(path, data, version, System.currentTimeMillis(),
cb);
Review comment:
If I say it won't, I guess you won't believe it so easily. Please take a
look at the code carefully. In general, it is not a recursive call, it is a
callback triggered in a different thread after this method is done. Even we
keep retrying, only one call exists in the stack.
----------------------------------------------------------------
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]