File tree 1 file changed +9
-0
lines changed
src/main/java/com/arangodb/internal/velocystream/internal
1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -72,6 +72,8 @@ public abstract class VstConnection<T> implements Connection {
72
72
private final Long ttl ;
73
73
74
74
private final Integer keepAliveInterval ;
75
+ private int keepAliveFailCounter = 0 ;
76
+
75
77
private final Boolean useSsl ;
76
78
private final SSLContext sslContext ;
77
79
@@ -139,8 +141,15 @@ protected T sendKeepAlive() {
139
141
private void keepAlive () {
140
142
try {
141
143
doKeepAlive ();
144
+ keepAliveFailCounter = 0 ;
142
145
} catch (Exception e ) {
143
146
LOGGER .error ("Got exception while performing keepAlive request:" , e );
147
+ keepAliveFailCounter ++;
148
+ if (keepAliveFailCounter >= 3 ) {
149
+ LOGGER .error ("KeepAlive request failed consecutively for 3 times, closing connection now..." );
150
+ messageStore .clear (new IOException ("Connection unresponsive!" ));
151
+ close ();
152
+ }
144
153
}
145
154
}
146
155
You can’t perform that action at this time.
0 commit comments