Skip to content

Commit

Permalink
S3ShuffleManager: Only try to clean up shuffle files if there are no …
Browse files Browse the repository at this point in the history
…registered shuffle ids.

Signed-off-by: Pascal Spörri <[email protected]>
  • Loading branch information
pspoerri committed Jul 14, 2023
1 parent 0b6c3af commit 106b9cd
Showing 1 changed file with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -167,16 +167,19 @@ private[spark] class S3ShuffleManager(conf: SparkConf) extends ShuffleManager wi

/** Shut down this ShuffleManager. */
override def stop(): Unit = {
val cleanupRequired = registeredShuffleIds.size > 0
registeredShuffleIds.foreach(
shuffleId => {
purgeCaches(shuffleId)
registeredShuffleIds.remove(shuffleId)
})
if (dispatcher.cleanupShuffleFiles) {
logInfo(f"Cleaning up shuffle files in ${dispatcher.rootDir}.")
dispatcher.removeRoot()
} else {
logInfo(f"Manually cleanup shuffle files in ${dispatcher.rootDir}")
if (cleanupRequired) {
if (dispatcher.cleanupShuffleFiles) {
logInfo(f"Cleaning up shuffle files in ${dispatcher.rootDir}.")
dispatcher.removeRoot()
} else {
logInfo(f"Manually cleanup shuffle files in ${dispatcher.rootDir}")
}
}
shuffleBlockResolver.stop()
}
Expand Down

0 comments on commit 106b9cd

Please sign in to comment.