otterc commented on code in PR #37624:
URL: https://github.com/apache/spark/pull/37624#discussion_r954102886


##########
common/network-shuffle/src/main/java/org/apache/spark/network/shuffle/RemoteBlockPushResolver.java:
##########
@@ -795,13 +796,34 @@ public void registerExecutor(String appId, 
ExecutorShuffleInfo executorInfo) {
   }
 
   /**
-   * Close the DB during shutdown
+   * Shutdown mergedShuffleCleaner and close the DB during shutdown
    */
   @Override
   public void close() {
+    if (!mergedShuffleCleaner.isShutdown()) {
+      // Use two phases shutdown refer to
+      // 
https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/ExecutorService.html
+      try {
+        mergedShuffleCleaner.shutdown();
+        // Wait a while for existing tasks to terminate
+        if (!mergedShuffleCleaner.awaitTermination(10L, TimeUnit.SECONDS)) {

Review Comment:
   The cleanup tasks that this service handles remove the 
`appAttemptShuffleMergeId` from the db and close and delete all the partition 
files. The db operation would not take much time. Closing and deleting all the 
merged shuffle files may take take longer. Maybe we can increase this to a 1 
minute?



-- 
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: reviews-unsubscr...@spark.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to