LuciferYang commented on code in PR #13107:
URL: https://github.com/apache/gluten/pull/13107#discussion_r4110675131


##########
gluten-core/src/main/scala/org/apache/spark/task/TaskResources.scala:
##########
@@ -290,12 +299,48 @@ class TaskResourceRegistry extends Logging {
 
   /** Release all managed resources according to priority and reversed order */
   private[task] def releaseAll(): Unit = lock {
+    val failures = mutable.ArrayBuffer.empty[Throwable]
+    def safeResourceName(resource: TaskResource): String =
+      try resource.resourceName()
+      catch {
+        // resourceName() is user code too, so a failure building the log label
+        // must not abort the loop either.
+        case NonFatal(_) => s"resource@${System.identityHashCode(resource)}"
+      }

Review Comment:
   Done in 5bc998d48. Reverted `safeResourceName` to catch `Throwable` (not 
`NonFatal`), so a throwing `resourceName()` — fatal or not — can no longer 
abort the loop before the remaining resources are freed and the maps cleared. 
This is scoped to the best-effort log-label lookup only; `release()` itself 
still catches `NonFatal`, so fatal errors from a real release continue to 
propagate immediately as intended.



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