Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
import org.apache.spark.network.buffer.ManagedBuffer;
import org.apache.spark.network.shuffle.protocol.ExecutorShuffleInfo;
import org.apache.spark.network.util.JavaUtils;
import org.apache.spark.network.util.NettyUtils;
import org.apache.spark.network.util.TransportConf;

/**
Expand All @@ -49,7 +50,7 @@
* the Executor's memory, unlike the IndexShuffleBlockManager.
*/
public class ExternalShuffleBlockManager {
private final Logger logger = LoggerFactory.getLogger(ExternalShuffleBlockManager.class);
private static final Logger logger = LoggerFactory.getLogger(ExternalShuffleBlockManager.class);

// Map containing all registered executors' metadata.
private final ConcurrentMap<AppExecId, ExecutorShuffleInfo> executors;
Expand All @@ -60,8 +61,9 @@ public class ExternalShuffleBlockManager {
private final TransportConf conf;

public ExternalShuffleBlockManager(TransportConf conf) {
// TODO: Give this thread a name.
this(conf, Executors.newSingleThreadExecutor());
this(conf, Executors.newSingleThreadExecutor(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe use NettyUtils.createThreadFactory() (could move that to JavaUtils too, less important).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should it be daemon or not? If it's daemon, it may not have enough time to delete all files when the service is exiting.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, this should be daemon, I think, otherwise it may prevent the JVM from exiting even when it's not doing anything. If we wanted to prevent the service from exiting before cleanup has completed, I would rather block in a stop() method until the queue of directories to delete has been drained, but I do not think this too important. Unlike Spark Executors, the graceful termination of this service should be uncorrelated with buildup of shuffle data.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree. Use NettyUtils.createThreadFactor now

// Add `spark` prefix because it will run in NM in Yarn mode.
NettyUtils.createThreadFactory("spark-shuffle-directory-cleaner")));
}

// Allows tests to have more control over when directories are cleaned up.
Expand Down