LuciferYang opened a new pull request, #13100:
URL: https://github.com/apache/gluten/pull/13100

   ## What changes are proposed in this pull request?
   
   `ShuffleManagerRegistry.register` guards against registering 
`GlutenShuffleManager` itself, which would make the router route into itself 
and recurse. The condition is inverted:
   
   ```scala
   require(
     !clazz.isAssignableFrom(classOf[GlutenShuffleManager]),
     "It's not allowed to register GlutenShuffleManager recursively")
   ```
   
   `!clazz.isAssignableFrom(classOf[GlutenShuffleManager])` only rejects 
`GlutenShuffleManager` and its supertypes; a subclass of `GlutenShuffleManager` 
passes. Registering one while `spark.shuffle.manager` is the experimental 
`GlutenShuffleManager` recurses on the first routed shuffle (`registerShuffle` 
→ `getOrBuild` → instantiate → route → …) until the stack overflows. The guard 
has been inverted since the registry was introduced in #8084, so it has never 
blocked a subclass.
   
   This adds the missing direction so the guard rejects `GlutenShuffleManager` 
and any subtype, keeping the supertype case it already covered. Legitimate 
managers such as `ColumnarShuffleManager` and `SortShuffleManager` are 
unaffected, since neither is related to `GlutenShuffleManager` by assignability.
   
   ## How was this patch tested?
   
   `GlutenShuffleManagerSuite` gains two cases: registering a 
`GlutenShuffleManager` subclass is now rejected (it was wrongly allowed 
before), and registering the `ShuffleManager` interface itself is still 
rejected.
   
   ## Was this patch authored or co-authored using generative AI tooling?
   
   Yes. Generated-by: ZCode (GLM-5.3).
   
   Related issue: #13099.


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