jackylee-ch commented on code in PR #13166:
URL: https://github.com/apache/gluten/pull/13166#discussion_r4240570620


##########
gluten-core/src/main/scala/org/apache/spark/task/TaskResources.scala:
##########
@@ -339,6 +358,7 @@ class TaskResourceRegistry extends Logging {
     }
     priorityToResourcesMapping.clear()
     resources.clear()
+    released = true

Review Comment:
   The description says every later call on a released registry fails with 
`IllegalStateException`, but `released = true` is only reached on the 
normal/`NonFatal` path — a fatal or control-flow throwable from a release 
callback unwinds past it while the listener's `finally` still removes the map 
entry, so a thread sharing the `TaskContext` would see `released == false` and 
could still register into the just-cleared registry (nothing then releases it). 
Could we set `released` in a `finally` so the guarantee holds on every exit 
path?



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