holdenk commented on code in PR #49032:
URL: https://github.com/apache/spark/pull/49032#discussion_r2519537588
##########
core/src/main/scala/org/apache/spark/MapOutputTracker.scala:
##########
@@ -758,6 +773,50 @@ private[spark] class MapOutputTrackerMaster(
private val availableProcessors = Runtime.getRuntime.availableProcessors()
+ def updateShuffleAtime(shuffleId: Int): Unit = {
+ if (conf.get(SPARK_TTL_SHUFFLE_BLOCK_CLEANER).isDefined) {
+ shuffleAccessTime.put(shuffleId, System.currentTimeMillis())
+ }
+ }
+
+ private class TTLCleaner extends Runnable {
+ override def run(): Unit = {
+ // Poll the shuffle access times if we're configured for it.
+ conf.get(SPARK_TTL_SHUFFLE_BLOCK_CLEANER) match {
+ case Some(ttl) =>
+ while (true) {
+ val maxAge = System.currentTimeMillis() - ttl
+ // Find the elements to be removed & update oldest remaining time
(if any)
+ var oldest = System.currentTimeMillis()
+ val toBeRemoved = shuffleAccessTime.asScala.flatMap { case
(shuffleId, atime) =>
Review Comment:
Yes this is a race condition, but as described it's intentional for write
perf because close enough works for the TTL.
--
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]