You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by mo...@apache.org on 2023/04/07 00:58:14 UTC

[doris] 04/07: [regression-test](log) add log for malforamt response of stream load (#18173)

This is an automated email from the ASF dual-hosted git repository.

morningman pushed a commit to branch branch-1.2-lts
in repository https://gitbox.apache.org/repos/asf/doris.git

commit 069b0a800eb98e4d86d95ed6c540fe85b46c76ea
Author: Mingyu Chen <mo...@163.com>
AuthorDate: Wed Mar 29 15:52:44 2023 +0800

    [regression-test](log) add log for malforamt response of stream load (#18173)
---
 .../regression/action/StreamLoadAction.groovy      | 54 ++++++++++++----------
 1 file changed, 29 insertions(+), 25 deletions(-)

diff --git a/regression-test/framework/src/main/groovy/org/apache/doris/regression/action/StreamLoadAction.groovy b/regression-test/framework/src/main/groovy/org/apache/doris/regression/action/StreamLoadAction.groovy
index 075f751ae9..18a54d1e15 100644
--- a/regression-test/framework/src/main/groovy/org/apache/doris/regression/action/StreamLoadAction.groovy
+++ b/regression-test/framework/src/main/groovy/org/apache/doris/regression/action/StreamLoadAction.groovy
@@ -314,7 +314,6 @@ class StreamLoadAction implements SuiteAction {
             long numberLoadedRows = result.NumberLoadedRows.toLong()
             if (numberTotalRows != numberLoadedRows) {
                 throw new IllegalStateException("Stream load rows mismatch:\n${responseText}")
-
             }
 
             if (time > 0) {
@@ -333,32 +332,37 @@ class StreamLoadAction implements SuiteAction {
     // So here we wait for at most 60s, using "show transaction" to check the
     // status of txn, and return once it become ABORTED or VISIBLE.
     private String waitForPublishOrFailure(String responseText) {
-        long maxWaitSecond = 60;
-        def jsonSlurper = new JsonSlurper()
-        def parsed = jsonSlurper.parseText(responseText)
-        String status = parsed.Status
-        long txnId = parsed.TxnId
-        if (!status.equalsIgnoreCase("Publish Timeout")) {
-            return status;
-        }
+        try {
+            long maxWaitSecond = 60;
+            def jsonSlurper = new JsonSlurper()
+            def parsed = jsonSlurper.parseText(responseText)
+            String status = parsed.Status
+            long txnId = parsed.TxnId
+            if (!status.equalsIgnoreCase("Publish Timeout")) {
+                return status;
+            }
 
-        log.info("Stream load with txn ${txnId} is publish timeout")
-        String sql = "show transaction from ${db} where id = ${txnId}"
-        String st = "PREPARE"
-        while (!st.equalsIgnoreCase("VISIBLE") && !st.equalsIgnoreCase("ABORTED") && maxWaitSecond > 0) {
-            Thread.sleep(2000)
-            maxWaitSecond -= 2
-            def (result, meta) = JdbcUtils.executeToStringList(context.getConnection(), sql)
-            if (result.size() != 1) {
-                throw new IllegalStateException("Failed to get txn's ${txnId}")
+            log.info("Stream load with txn ${txnId} is publish timeout")
+            String sql = "show transaction from ${db} where id = ${txnId}"
+            String st = "PREPARE"
+            while (!st.equalsIgnoreCase("VISIBLE") && !st.equalsIgnoreCase("ABORTED") && maxWaitSecond > 0) {
+                Thread.sleep(2000)
+                maxWaitSecond -= 2
+                def (result, meta) = JdbcUtils.executeToStringList(context.getConnection(), sql)
+                if (result.size() != 1) {
+                    throw new IllegalStateException("Failed to get txn's ${txnId}")
+                }
+                st = String.valueOf(result[0][3])
             }
-            st = String.valueOf(result[0][3])
-        }
-        log.info("Stream load with txn ${txnId} is ${st}")
-        if (st.equalsIgnoreCase("VISIBLE")) {
-            return "Success";
-        } else {
-            return "Fail";
+            log.info("Stream load with txn ${txnId} is ${st}")
+            if (st.equalsIgnoreCase("VISIBLE")) {
+                return "Success";
+            } else {
+                return "Fail";
+            }
+        } catch (Throwable t) {
+            log.info("failed to waitForPublishOrFailure. response: ${responseText}", t);
+            throw t;
         }
     }
 }


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org