mirror of
https://github.com/actiontech/dble.git
synced 2026-01-05 12:20:19 -06:00
ok packet of conn heartbeat returns when heartTimeout isn't initialized (#2547)
This commit is contained in:
@@ -43,11 +43,13 @@ public class ConnectionHeartBeatHandler implements ResponseHandler {
|
||||
}
|
||||
|
||||
public boolean ping(long timeout) {
|
||||
conn.getService().writeDirectly(PingPacket.PING);
|
||||
if (heartbeatLock != null) {
|
||||
conn.getService().writeDirectly(PingPacket.PING);
|
||||
synchronized (heartbeatLock) {
|
||||
try {
|
||||
heartbeatLock.wait(timeout);
|
||||
while (!finished) {
|
||||
heartbeatLock.wait(timeout);
|
||||
}
|
||||
} catch (InterruptedException e) {
|
||||
finished = false;
|
||||
}
|
||||
@@ -55,6 +57,7 @@ public class ConnectionHeartBeatHandler implements ResponseHandler {
|
||||
return finished;
|
||||
} else {
|
||||
heartbeatTimeout = TimerHolder.getTimer().newTimeout(timeout1 -> conn.businessClose("conn heart timeout"), timeout, TimeUnit.MILLISECONDS);
|
||||
conn.getService().writeDirectly(PingPacket.PING);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -87,7 +87,7 @@ public class SqlLog extends ManagerBaseTable {
|
||||
} else {
|
||||
map.put(COLUMN_SQL_STMT, sqlRecord.getStmt());
|
||||
}
|
||||
map.put(COLUMN_SQL_TYPE, sqlRecord.getSqlId() + "");
|
||||
map.put(COLUMN_SQL_TYPE, sqlRecord.getSqlType() + "");
|
||||
map.put(COLUMN_TX_ID, sqlRecord.getTxId() + "");
|
||||
map.put(COLUMN_ENTRY, sqlRecord.getEntry() + "");
|
||||
map.put(COLUMN_USER, sqlRecord.getUser());
|
||||
|
||||
Reference in New Issue
Block a user