kezhuw commented on code in PR #453:
URL: https://github.com/apache/curator/pull/453#discussion_r1155239661
##########
curator-framework/src/main/java/org/apache/curator/framework/imps/CreateBuilderImpl.java:
##########
@@ -770,14 +790,24 @@ static <T> void backgroundCreateParentsThenNode(final
CuratorFrameworkImpl clien
@Override
public void performBackgroundOperation(OperationAndData<T> dummy)
throws Exception
{
+ AtomicReference<CuratorEvent> event = new AtomicReference<>();
+ AsyncCallback.Create2Callback callback = new
AsyncCallback.Create2Callback()
+ {
+ @Override
+ public void processResult(int rc, String path, Object ctx,
String name, Stat stat)
+ {
+ event.set(createResponseEvent(client, rc, path, ctx,
name, stat));
+ }
+ };
try
{
- ZKPaths.mkdirs(client.getZooKeeper(), path, false,
aclProvider, createParentsAsContainers);
+ ZKPaths.mkdirs(client.getZooKeeper(), path, false,
aclProvider, createParentsAsContainers, callback);
}
catch ( KeeperException e )
{
if (
!client.getZookeeperClient().getRetryPolicy().allowRetry(e) )
{
+
client.processBackgroundOperation(mainOperationAndData, event.get());
Review Comment:
@tisonkun On exception, `name` should be `null` as no node is created. But
this won't affect final result as `KeeperException` needs only
`CuratorEvent::getResultCode` and `CuratorEvent::getPath` to reconstruct itself.
--
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]