mirror of
https://github.com/actiontech/dble.git
synced 2026-01-03 03:10:22 -06:00
[inner-2371] fix: sql execution hang problem caused by the inability to respond to the front side due to unprocessed packets.
(cherry picked from commit dcff228b4c13bf0fd9f7bb0d52f9c18aaba36b59、07c0c1f1c986a71fb74d0fcc0379965592c63b49)
This commit is contained in:
@@ -131,7 +131,7 @@ public abstract class BackendService extends AbstractService {
|
||||
handleDataError(e);
|
||||
} finally {
|
||||
isHandling.set(false);
|
||||
if (taskQueue.size() > 0) {
|
||||
if (!taskQueue.isEmpty()) {
|
||||
doHandle(task);
|
||||
}
|
||||
}
|
||||
@@ -232,7 +232,7 @@ public abstract class BackendService extends AbstractService {
|
||||
protected void handleDataError(Exception e) {
|
||||
LOGGER.warn(this.toString() + " handle data error:", e);
|
||||
connection.close("handle data error:" + e.getMessage());
|
||||
while (taskQueue.size() > 0) {
|
||||
while (!taskQueue.isEmpty()) {
|
||||
clearTaskQueue();
|
||||
readSize.set(0);
|
||||
// clear all data from the client
|
||||
@@ -674,8 +674,8 @@ public abstract class BackendService extends AbstractService {
|
||||
handleDataError(e);
|
||||
} finally {
|
||||
isHandling.set(false);
|
||||
if (taskQueue.size() > 0) {
|
||||
doHandle(null);
|
||||
if (!taskQueue.isEmpty()) {
|
||||
doHandle(taskQueue.peek());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -528,7 +528,7 @@ public class MySQLResponseService extends BackendService {
|
||||
@Override
|
||||
protected Executor getExecutor() {
|
||||
Executor executor;
|
||||
if (complexQuery) {
|
||||
if (complexQuery || SystemConfig.getInstance().getUsePerformanceMode() == 1) {
|
||||
executor = DbleServer.getInstance().getComplexQueryExecutor();
|
||||
} else {
|
||||
executor = DbleServer.getInstance().getBackendExecutor();
|
||||
|
||||
Reference in New Issue
Block a user