LuciferYang commented on code in PR #37624:
URL: https://github.com/apache/spark/pull/37624#discussion_r953368551
##########
common/network-shuffle/src/main/java/org/apache/spark/network/shuffle/RemoteBlockPushResolver.java:
##########
@@ -795,13 +796,25 @@ 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()) {
+ try {
+ mergedShuffleCleaner.shutdown();
+ boolean terminated = mergedShuffleCleaner.awaitTermination(10L,
TimeUnit.SECONDS);
+ if (!terminated) {
+ mergedShuffleCleaner.shutdownNow();
+ }
+ } catch (InterruptedException ignored) {
+ // ignore InterruptedException.
+ }
+ }
Review Comment:
```
pool.shutdown(); // Disable new tasks from being submitted
try {
// Wait a while for existing tasks to terminate
if (!pool.awaitTermination(60, TimeUnit.SECONDS)) {
pool.shutdownNow(); // Cancel currently executing tasks
// Wait a while for tasks to respond to being cancelled
if (!pool.awaitTermination(60, TimeUnit.SECONDS))
System.err.println("Pool did not terminate");
}
} catch (InterruptedException ie) {
// (Re-)Cancel if current thread also interrupted
pool.shutdownNow();
// Preserve interrupt status
Thread.currentThread().interrupt();
}
```
like above?
--
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]