From 24f49013aee7cbd39eebab36145b9746cef8764b Mon Sep 17 00:00:00 2001 From: wenyh1 <2365151147@qq.com> Date: Tue, 31 Oct 2023 18:03:06 +0800 Subject: [PATCH] [inner-2371] fix: sql execution hang problem caused by the inability to respond to the front side due to unprocessed packets. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (cherry picked from commit dcff228b4c13bf0fd9f7bb0d52f9c18aaba36b59、07c0c1f1c986a71fb74d0fcc0379965592c63b49) --- .../dble/services/mysqlsharding/MySQLResponseService.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/actiontech/dble/services/mysqlsharding/MySQLResponseService.java b/src/main/java/com/actiontech/dble/services/mysqlsharding/MySQLResponseService.java index 9caa4a8795..e9f6d8a17b 100644 --- a/src/main/java/com/actiontech/dble/services/mysqlsharding/MySQLResponseService.java +++ b/src/main/java/com/actiontech/dble/services/mysqlsharding/MySQLResponseService.java @@ -211,7 +211,7 @@ protected boolean beforeHandlingTask() { @Override public void taskToTotalQueue(ServiceTask task) { Executor executor; - if (this.isComplexQuery()) { + if (this.isComplexQuery() || SystemConfig.getInstance().getUsePerformanceMode() == 1) { executor = DbleServer.getInstance().getComplexQueryExecutor(); } else { executor = DbleServer.getInstance().getBackendBusinessExecutor(); @@ -227,8 +227,8 @@ public void run() { handleDataError(e); } finally { isHandling.set(false); - if (taskQueue.size() > 0) { - taskToTotalQueue(null); + if (!taskQueue.isEmpty()) { + taskToTotalQueue(taskQueue.peek()); } } } @@ -238,7 +238,7 @@ public void run() { protected void handleDataError(Exception e) { LOGGER.info(this.toString() + " handle data error:", e); - while (taskQueue.size() > 0) { + while (!taskQueue.isEmpty()) { clearTaskQueue(); // clear all data from the client LockSupport.parkNanos(TimeUnit.MILLISECONDS.toNanos(1000));