fix npe when the frontend connection is closed, the statement is still send (#3470)

This commit is contained in:
ylinzhu
2022-11-15 10:03:31 +08:00
committed by lin
parent 7c9d29a5d1
commit 3e22f8bda4

View File

@@ -24,6 +24,7 @@ import org.jetbrains.annotations.NotNull;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
import java.util.List;
@@ -48,7 +49,8 @@ public class BaseSelectHandler extends BaseDMLHandler {
public BackendConnection initConnection() throws Exception {
if (serverSession.closed()) {
return null;
LOGGER.warn(" FrontendConnection is closed without sending a statement, conn is " + serverSession.getShardingService().getConnection());
throw new IOException("FrontendConnection is closed");
}
BackendConnection exeConn = serverSession.getTarget(rrss);