karuppayya commented on code in PR #52606:
URL: https://github.com/apache/spark/pull/52606#discussion_r2430089135


##########
core/src/main/scala/org/apache/spark/storage/BlockManagerStorageEndpoint.scala:
##########
@@ -57,7 +57,14 @@ class BlockManagerStorageEndpoint(
 
     case RemoveShuffle(shuffleId) =>
       doAsync[Boolean](log"removing shuffle ${MDC(SHUFFLE_ID, shuffleId)}", 
context) {
-        if (mapOutputTracker != null) {
+        if (mapOutputTracker != null && 
!mapOutputTracker.isInstanceOf[MapOutputTrackerMaster]) {

Review Comment:
   Should this be in check be in  `unregistershuffle` if we dont expect this to 
be called in master. 
   There can be someone else calling this same method on local mode in future?



##########
core/src/main/scala/org/apache/spark/storage/BlockManagerStorageEndpoint.scala:
##########
@@ -57,7 +57,14 @@ class BlockManagerStorageEndpoint(
 
     case RemoveShuffle(shuffleId) =>
       doAsync[Boolean](log"removing shuffle ${MDC(SHUFFLE_ID, shuffleId)}", 
context) {
-        if (mapOutputTracker != null) {
+        if (mapOutputTracker != null && 
!mapOutputTracker.isInstanceOf[MapOutputTrackerMaster]) {
+          // SPARK-53898: `MapOutputTrackerMaster.unregisterShuffle()` should 
only be called
+          // through `ContextCleaner` when the shuffle is considered no longer 
referenced anywhere.
+          // Otherwise, we might hit exceptions if there is any subsequent 
access (which still
+          // reference that shuffle) to that shuffle metadata in 
`MapOutputTrackerMaster`. E.g.,
+          // an ongoing subquery could access the same shuffle metadata which 
could have been

Review Comment:
   I am not sure if we should mention this, since the ideal behavior would be 
to terminate any subqueries when the main query completes.
   



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

Reply via email to