Merge pull request #3839 from actiontech/inner-2371

[inner-2371] fix: sql execution hang problem caused by the inability to respond to the front side due to unprocessed packets.
This commit is contained in:
wenyh
2023-11-13 13:48:24 +08:00
committed by GitHub

View File

@@ -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
@@ -697,8 +697,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());
}
}
}