Github user arina-ielchiieva commented on a diff in the pull request:

    https://github.com/apache/drill/pull/669#discussion_r89993367
  
    --- 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();
           if (retryAttempts-- == 0) {
             throw new DrillRuntimeException("Failed to update remote function 
registry. Exceeded retry attempts limit.");
           }
           initRemoteRegistration(functions, jarManager, remoteRegistry, 
retryAttempts);
    -    } finally {
    -      if (cleanUp) {
    -        jarManager.deleteQuietlyFromRegistryArea();
    -      }
    +    } catch (Exception e) {
    --- End diff --
    
    You are right. Updated the code, so now we delete jars only once on error.


---
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 [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to