Sfoglia il codice sorgente

YARN-10328. Fixed ZK Curator NodeExists exception in YARN service AM logs
Contributed by Bilwa S T via eyang

Eric Yang 5 anni fa
parent
commit
0be26811f3

+ 4 - 1
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-services/hadoop-yarn-services-core/src/main/java/org/apache/hadoop/yarn/service/registry/YarnRegistryViewForProviders.java

@@ -143,7 +143,10 @@ public class YarnRegistryViewForProviders {
       ServiceRecord record) throws IOException {
     String path = RegistryUtils.componentPath(
         user, serviceClass, serviceName, componentName);
-    registryOperations.mknode(RegistryPathUtils.parentOf(path), true);
+    String parentPath = RegistryPathUtils.parentOf(path);
+    if (!registryOperations.exists(parentPath)) {
+      registryOperations.mknode(parentPath, true);
+    }
     registryOperations.bind(path, record, BindFlags.OVERWRITE);
   }