Skip to content

Commit b895199

Browse files
author
chengyitian
committed
AJ-770: opzimize single node reconnect 'log info' and 'code logic';
1 parent 09e86a8 commit b895199

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/com/xxdb/DBConnection.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@ private enum ExceptionType{
6565
ET_NODENOTAVAIL(3),
6666
ET_NOINITIALIZED(4),
6767
ET_NOTLEADER(5),
68-
ET_READTIMEDOUT(6);
68+
ET_READTIMEDOUT(6),
69+
ET_NORESPONSEHEADER(7);
6970

7071
public int value;
7172
ExceptionType(int value){
@@ -1048,7 +1049,8 @@ else if (type == ExceptionType.ET_NODENOTAVAIL)
10481049
throw e;
10491050
}
10501051
} else {
1051-
log.error(e.getMessage());
1052+
if (Objects.nonNull(e.getMessage()))
1053+
log.error(e.getMessage());
10521054
return false;
10531055
}
10541056
}
@@ -1099,6 +1101,9 @@ public ExceptionType parseException(String msg, Node node) {
10991101
} else if (msg.contains("Read timed out")) {
11001102
conn_.getNode(node);
11011103
return ExceptionType.ET_READTIMEDOUT;
1104+
} else if (msg.contains("Failed to read response header from the socket with IO error null")) {
1105+
conn_.getNode(node);
1106+
return ExceptionType.ET_NORESPONSEHEADER;
11021107
} else {
11031108
node.hostName = "";
11041109
node.port = 0;

0 commit comments

Comments
 (0)