fix npe when innerRelease and close are concurrent inner 1883 (#3471)

This commit is contained in:
ylinzhu
2022-11-15 10:03:44 +08:00
committed by lin
parent 5ceddefa09
commit 535669fcba
2 changed files with 5 additions and 1 deletions
@@ -162,7 +162,7 @@ public abstract class AbstractService extends VariablesService implements Servic
connection.getSocketWR().disableReadForever();
}
if (closeTask.isFirst() && !connection.isOnlyFrontTcpConnected()) {
LOGGER.info("prepare close for conn.conn id {},reason [{}]", connection.getId(), closeTask.getReasonsStr());
LOGGER.info("prepare close for conn {},reason [{}]", connection, closeTask.getReasonsStr());
}
break;
@@ -12,6 +12,7 @@ import com.actiontech.dble.net.handler.BackEndRecycleRunnable;
import com.actiontech.dble.net.mysql.*;
import com.actiontech.dble.net.response.*;
import com.actiontech.dble.net.service.ServiceTask;
import com.actiontech.dble.net.service.ServiceTaskType;
import com.actiontech.dble.net.service.WriteFlags;
import com.actiontech.dble.route.RouteResultsetNode;
import com.actiontech.dble.server.NonBlockingSession;
@@ -494,6 +495,9 @@ public class MySQLResponseService extends BackendService {
@Override
protected void beforeInsertServiceTask(@NotNull ServiceTask task) {
super.beforeInsertServiceTask(task);
if (task.getType() == ServiceTaskType.CLOSE) {
return;
}
if (session != null) {
session.setBackendResponseTime(this);
}