yaooqinn commented on a change in pull request #1312:
URL: https://github.com/apache/incubator-kyuubi/pull/1312#discussion_r739973585



##########
File path: 
kyuubi-server/src/main/scala/org/apache/kyuubi/operation/ExecuteStatement.scala
##########
@@ -83,18 +83,39 @@ class ExecuteStatement(
 
   private def waitStatementComplete(): Unit = try {
     setState(OperationState.RUNNING)
-    var statusResp = client.GetOperationStatus(statusReq)
+    var statusResp: TGetOperationStatusResp = null
+    var currentAttempts = 0
+
+    def getOperationStatusWithRetry: Unit = {
+      try {
+        statusResp = client.getOperationStatus(_remoteOpHandle)
+        currentAttempts = 0 // reset attempts whenever get touch with engine 
again
+      } catch {
+        case e: TException if currentAttempts >= maxStatusPollOnFailure =>
+          error(s"Failed to get ${session.user}'s query[$getHandle] status 
after" +
+            s" $maxStatusPollOnFailure times, aborting", e)
+          throw e
+        case e: TException =>
+          currentAttempts += 1
+          warn(s"Failed to get ${session.user}'s query[$getHandle] status" +
+            s" ($currentAttempts / $maxStatusPollOnFailure)", e)
+          Thread.sleep(500)

Review comment:
       Look fine to me to be hardcoded. As users already have 
operation.status.polling.timeout




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


Reply via email to