vrozov commented on code in PR #49276:
URL: https://github.com/apache/spark/pull/49276#discussion_r1905953652


##########
sql/core/src/main/scala/org/apache/spark/sql/execution/CacheManager.scala:
##########
@@ -241,16 +247,19 @@ class CacheManager extends Logging with 
AdaptiveSparkPlanHelper {
       spark: SparkSession,
       isMatchedPlan: LogicalPlan => Boolean,
       cascade: Boolean,
-      blocking: Boolean): Unit = {
+      blocking: Boolean): Boolean = {
     val shouldRemove: LogicalPlan => Boolean =
       if (cascade) {
         _.exists(isMatchedPlan)
       } else {
         isMatchedPlan
       }
-    val plansToUncache = cachedData.filter(cd => shouldRemove(cd.plan))
+    var plansToUncache: IndexedSeq[CachedData] = null

Review Comment:
   @gengliangwang logging relies on the `plansToUncache.nonEmpty` added on line 
288 to correctly log warnings, so the change is necessary to prevent race 
condition (`cacheData` should be accessed under `synchronized`).



-- 
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