anthonychengit commented on code in PR #7640:
URL: https://github.com/apache/texera/pull/7640#discussion_r3867594885
##########
amber/src/main/scala/org/apache/texera/web/resource/SyncExecutionResource.scala:
##########
@@ -832,6 +832,19 @@ class SyncExecutionResource extends LazyLogging {
}
}
+ private def isCausedByTimeout(error: Throwable): Boolean = {
+ @scala.annotation.tailrec
+ def loop(current: Throwable): Boolean =
+ current match {
+ case null => false
+ case _: java.util.concurrent.TimeoutException => true
+ case throwable if throwable.getCause eq throwable => false
+ case throwable =>
loop(throwable.getCause)
Review Comment:
Addressed in 3e3b6a97d. The traversal now tracks visited Throwable instances
by identity with IdentityHashMap and returns false when an identity repeats. A
two-node cyclic-cause regression test failed against the previous loop and now
passes. Verification: all 3 isCausedByTimeout tests passed; scalafixAll
--check, scalafmtCheckAll, and git diff --check passed.
--
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]