JNSimba commented on code in PR #117:
URL: 
https://github.com/apache/doris-spark-connector/pull/117#discussion_r1308411133


##########
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:
   Will there be any problems with this judgment, for example, it is not -235, 
but -235 appears?



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