RussellSpitzer commented on a change in pull request #4126:
URL: https://github.com/apache/iceberg/pull/4126#discussion_r807434174



##########
File path: 
spark/v3.2/spark/src/main/java/org/apache/iceberg/spark/procedures/BaseProcedure.java
##########
@@ -151,4 +168,31 @@ TableCatalog tableCatalog() {
       return tableCatalog;
     }
   }
+
+  /**
+   * Closes the procedure's executor service if a new one was created.
+   */
+  protected void closeService() {
+    if (executorService != null) {
+      executorService.shutdown();
+      try {
+        executorService.awaitTermination(1, TimeUnit.SECONDS);

Review comment:
       I'd actually leave it smaller if I could. Ideally we shouldn't be 
calling this method ("closeService") until all the work on the pool is already 
complete. Otherwise the procedure somehow returned results without having 
completed all the work. In our current procedures that is impossible.
   
    I also have no problem with just removing this try block entirely and just 
having the `shutdown()` command all by itself.  That's what I originally had 
but I think I misunderstood one of @kbendick 's worries 




-- 
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]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to