From abcf33fa68595b7aceef0bedfcb13cad6973a552 Mon Sep 17 00:00:00 2001 From: guoaomen Date: Thu, 7 Sep 2023 15:46:54 +0800 Subject: [PATCH] [inner-2339] fix: create connection timeout check should exclude connections in use (changeUser case) --- src/main/java/com/actiontech/dble/net/IOProcessor.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/actiontech/dble/net/IOProcessor.java b/src/main/java/com/actiontech/dble/net/IOProcessor.java index 4a6105d40..925a4d608 100644 --- a/src/main/java/com/actiontech/dble/net/IOProcessor.java +++ b/src/main/java/com/actiontech/dble/net/IOProcessor.java @@ -209,10 +209,10 @@ public final class IOProcessor { continue; } - // a connection in change user if (c.getService() instanceof MySQLBackAuthService) { //when the connection creation time is greater than the connectionTimeout, it is a network timeout - if (cost >= c.getConnectionTimeout()) { + //except for the scenario of changing user,see it:com.actiontech.dble.services.mysqlsharding.MySQLResponseService.changeUser + if (c.getState() != PooledConnection.STATE_IN_USE && cost >= c.getConnectionTimeout()) { c.close("Create connection timed out"); } continue;