LuciferYang commented on code in PR #12658:
URL: https://github.com/apache/gluten/pull/12658#discussion_r3680421994
##########
gluten-core/src/main/scala/org/apache/gluten/component/Component.scala:
##########
@@ -47,10 +47,23 @@ trait Component {
if (!isRegistered.compareAndSet(false, true)) {
return
}
- graph.add(this)
+ try {
+ graph.add(this)
+ } catch {
+ // Nothing entered the graph, so Graph#clear will not see this component
and cannot reset
+ // its flag. Roll the flag back here to keep it in sync with the graph.
+ case t: Throwable =>
+ isRegistered.set(false)
+ throw t
+ }
Review Comment:
Fixed in db5f076. `graph.add` only throws `IllegalArgumentException` from
its own `require` checks, so `NonFatal` covers every case the rollback is meant
for, and rolling back a registration flag on a `VirtualMachineError` would
serve no purpose anyway.
--
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]