Skip to content

Commit

Permalink
[inner-2371] fix: sql execution hang problem caused by the inability …
Browse files Browse the repository at this point in the history
…to respond to the front side due to unprocessed packets.

(cherry picked from commit dcff228、07c0c1f1c986a71fb74d0fcc0379965592c63b49)
  • Loading branch information
wenyh1 committed Jan 1, 2024
1 parent 5eb3652 commit 363fde3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ protected void doHandle(ServiceTask task) {
handleDataError(e);
} finally {
isHandling.set(false);
if (taskQueue.size() > 0) {
doHandle(null);
if (!taskQueue.isEmpty()) {
doHandle(taskQueue.peek());
}
}
});
Expand All @@ -125,7 +125,7 @@ public void execute(ServiceTask task) {
handleDataError(e);
} finally {
isHandling.set(false);
if (taskQueue.size() > 0) {
if (!taskQueue.isEmpty()) {
doHandle(task);
}
}
Expand Down Expand Up @@ -215,7 +215,7 @@ protected void handleInnerData(byte[] data) {
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();
// clear all data from the client
LockSupport.parkNanos(TimeUnit.MILLISECONDS.toNanos(1000));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@ protected boolean beforeHandlingTask() {
@Override
protected Executor getExecutor() {
Executor executor;
if (complexQuery) {
if (complexQuery || SystemConfig.getInstance().getUsePerformanceMode() == 1) {
executor = DbleServer.getInstance().getComplexQueryExecutor();
} else {
executor = DbleServer.getInstance().getBackendBusinessExecutor();
Expand Down

0 comments on commit 363fde3

Please sign in to comment.