Copilot commented on code in PR #7640:
URL: https://github.com/apache/texera/pull/7640#discussion_r3840123731
##########
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:
This only stops a self-referential cause. Java permits longer cycles (for
example, `a.initCause(b); b.initCause(a)`), so such a chain makes this
tail-recursive loop run forever while classifying the caught exception. Track
every visited `Throwable` by identity and return `false` when one repeats; add
a two-node cyclic-chain regression test as well.
--
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]