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.
  • Loading branch information
wenyh1 committed Oct 31, 2023
1 parent d5f2b72 commit dcff228
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ public void execute(ServiceTask task, ThreadContext threadContext) {
handleDataError(e);
} finally {
isHandling.set(false);
if (taskQueue.size() > 0) {
if (!taskQueue.isEmpty()) {
doHandle(task);
}
}
Expand Down Expand Up @@ -232,7 +232,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();
readSize.set(0);
// clear all data from the client
Expand Down Expand Up @@ -697,8 +697,8 @@ public void run() {
handleDataError(e);
} finally {
isHandling.set(false);
if (taskQueue.size() > 0) {
doHandle(null);
if (!taskQueue.isEmpty()) {
doHandle(taskQueue.peek());
}
}
}
Expand Down

0 comments on commit dcff228

Please sign in to comment.