You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@curator.apache.org by "kezhuw (via GitHub)" <gi...@apache.org> on 2023/06/12 07:01:06 UTC

[GitHub] [curator] kezhuw commented on a diff in pull request #467: CURATOR-677: Complete BackgroundCallback if sub operation failed or cancelled

kezhuw commented on code in PR #467:
URL: https://github.com/apache/curator/pull/467#discussion_r1226161267


##########
curator-framework/src/main/java/org/apache/curator/framework/imps/CreateBuilderImpl.java:
##########
@@ -773,25 +768,21 @@ public void processResult(int rc, String path, Object ctx, Stat stat) {
         BackgroundOperation<PathAndBytes> operation = new BackgroundOperation<PathAndBytes>() {
             @Override
             public void performBackgroundOperation(OperationAndData<PathAndBytes> op) throws Exception {
-                try {
-                    client.getZooKeeper()
-                            .setData(
-                                    path,
-                                    mainOperationAndData.getData().getData(),
-                                    setDataIfExistsVersion,
-                                    statCallback,
-                                    backgrounding.getContext());
-                } catch (KeeperException e) {
-                    // ignore

Review Comment:
   I don't know how this could happen. But if it happen in real, it should go to exception path instead of ignore.



##########
curator-framework/src/main/java/org/apache/curator/framework/imps/CreateBuilderImpl.java:
##########
@@ -736,8 +734,6 @@ public void performBackgroundOperation(OperationAndData<T> dummy) throws Excepti
                     ZKPaths.mkdirs(client.getZooKeeper(), path, false, aclProvider, createParentsAsContainers);
                 } catch (KeeperException e) {
                     if (!client.getZookeeperClient().getRetryPolicy().allowRetry(e)) {
-                        sendBackgroundResponse(
-                                client, e.code().intValue(), e.getPath(), null, null, null, mainOperationAndData);
                         throw e;

Review Comment:
   These two statements will complete twice of `BackgroundCallback`.  [`abortOperation`](https://github.com/apache/curator/blob/master/curator-framework/src/main/java/org/apache/curator/framework/imps/CuratorFrameworkImpl.java#L974-L976) introduced in #464 will complete this anyway.
   
   Besides above, the deleted call omitted `OperationAndData.context`.



-- 
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: commits-unsubscribe@curator.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org