CodeCooker17 commented on code in PR #117: URL: https://github.com/apache/doris-spark-connector/pull/117#discussion_r1318266990
########## spark-doris-connector/src/main/scala/org/apache/doris/spark/sql/Utils.scala: ########## @@ -165,19 +165,39 @@ private[spark] object Utils { } @tailrec - def retry[R, T <: Throwable : ClassTag](retryTimes: Int, interval: Duration, logger: Logger)(f: => R): Try[R] = { + def retry[R, T <: Throwable : ClassTag](retryTimes: Int, maxBlockTimes: Int, batchInterval: Duration, maxBlockInterval: Duration, + blockTriggerKeysArray: Array[String], logger: Logger)(f: => R): Try[R] = { assert(retryTimes >= 0) + assert(maxBlockTimes >= 0) + var currentBlockInterval = batchInterval + + def increaseBackoffTime(): Unit = { + currentBlockInterval = Duration.ofNanos(Math.min(batchInterval.toNanos * 2, maxBlockInterval.toNanos)) + } + + def shouldBlock(exception: String): Boolean = { + blockTriggerKeysArray.exists(exception.contains) Review Comment: In order to prevent misjudgment, you can set a more identifiable key, such as 'err=-235,error-238' -- 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: commits-unsubscr...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org