File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -68,7 +68,8 @@ private enum ExceptionType{
68
68
ET_NEWLEADER (2 ),
69
69
ET_NODENOTAVAIL (3 ),
70
70
ET_NOINITIALIZED (4 ),
71
- ET_NOTLEADER (5 );
71
+ ET_NOTLEADER (5 ),
72
+ ET_READTIMEDOUT (6 );
72
73
73
74
public int value ;
74
75
ExceptionType (int value ){
@@ -989,7 +990,8 @@ public void switchDataNode(Node node) throws IOException{
989
990
attempt ++;
990
991
if (node .hostName != null && node .hostName .length () > 0 ) {
991
992
if (connectNode (node )) {
992
- log .info ("Switch to node: " + node .hostName + ":" + node .port + " successfully." );
993
+ if (nodes_ .size () > 1 )
994
+ log .info ("Switch to node: " + node .hostName + ":" + node .port + " successfully." );
993
995
isConnected = true ;
994
996
break ;
995
997
}
@@ -1093,7 +1095,10 @@ public ExceptionType parseException(String msg, Node node){
1093
1095
node .hostName = "" ;
1094
1096
node .port = 0 ;
1095
1097
return ExceptionType .ET_NOINITIALIZED ;
1096
- }else {
1098
+ } else if (msg .contains ("Failed to read response header from the socket with IO error Read timed out" )) {
1099
+ conn_ .getNode (node );
1100
+ return ExceptionType .ET_READTIMEDOUT ;
1101
+ } else {
1097
1102
node .hostName = "" ;
1098
1103
node .port = 0 ;
1099
1104
return ExceptionType .ET_UNKNOW ;
You can’t perform that action at this time.
0 commit comments