dongjoon-hyun commented on a change in pull request #32625: URL: https://github.com/apache/spark/pull/32625#discussion_r637598685
########## File path: core/src/main/java/org/apache/spark/memory/TaskMemoryManager.java ########## @@ -202,14 +202,22 @@ public long acquireExecutionMemory(long required, MemoryConsumer consumer) { } } - // call spill() on itself - if (got < required) { + // Attempt to free up memory by self-spilling. + // + // When our spill handler releases memory, `ExecutionMemoryPool#releaseMemory()` will + // immediately notify other tasks that memory has been freed, and they may acquire the + // newly-freed memory before we have a chance to do so (SPARK-35486). In that case, we will + // try again in the next loop iteration. + while (got < required) { Review comment: How many times does this expect to iterate in the worst case? -- 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. 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