Skip to content

Commit

Permalink
[inner-2339] fix: create connection timeout check should exclude conn…
Browse files Browse the repository at this point in the history
…ections in use (changeUser case)
  • Loading branch information
LUAgam committed Sep 12, 2023
1 parent 9625734 commit 04f5209
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/java/com/actiontech/dble/net/IOProcessor.java
Original file line number Diff line number Diff line change
Expand Up @@ -189,10 +189,10 @@ private void backendCheck() {
}
long cost = System.currentTimeMillis() - c.getStartupTime();

// 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;
Expand Down

0 comments on commit 04f5209

Please sign in to comment.