Github user paul-rogers commented on a diff in the pull request: https://github.com/apache/drill/pull/669#discussion_r89847859 --- Diff: exec/java-exec/src/main/java/org/apache/drill/exec/planner/sql/handlers/CreateFunctionHandler.java --- @@ -175,22 +175,20 @@ private void initRemoteRegistration(List<String> functions, List<Jar> remoteJars = remoteRegistry.getRegistry(version).getJarList(); validateAgainstRemoteRegistry(remoteJars, jarManager.getBinaryName(), functions); jarManager.copyToRegistryArea(); - boolean cleanUp = true; List<Jar> jars = Lists.newArrayList(remoteJars); jars.add(Jar.newBuilder().setName(jarManager.getBinaryName()).addAllFunctionSignature(functions).build()); Registry updatedRegistry = Registry.newBuilder().addAllJar(jars).build(); try { remoteRegistry.updateRegistry(updatedRegistry, version); - cleanUp = false; } catch (VersionMismatchException ex) { + jarManager.deleteQuietlyFromRegistryArea(); --- End diff -- I wonder about the retry approach. If we get a version mis-match, it means that something has changed: some other agent is modifying the registry at the same time. How should this be handed? Fixed number of retry? Wait and retry? Presumably, after some time, the system will get less busy, or we'll finally get our crack at the registry. Also, is it wise to use recursion to retry? Doing so causes a stack depth proportional to the retry count, which may not be ideal. Loop instead?
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---