This is an automated email from the ASF dual-hosted git repository. dataroaring pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/master by this push: new 238223fb8b [regression-test](log) add log for malforamt response of stream load (#18173) 238223fb8b is described below commit 238223fb8ba3f18312be54ffd88a74c6f0fae3b4 Author: Mingyu Chen <morning...@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-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org