File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
src/main/java/com/arangodb/internal/velocystream/internal Expand file tree Collapse file tree 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 {
7272 private final Long ttl ;
7373
7474 private final Integer keepAliveInterval ;
75+ private int keepAliveFailCounter = 0 ;
76+
7577 private final Boolean useSsl ;
7678 private final SSLContext sslContext ;
7779
@@ -139,8 +141,15 @@ protected T sendKeepAlive() {
139141 private void keepAlive () {
140142 try {
141143 doKeepAlive ();
144+ keepAliveFailCounter = 0 ;
142145 } catch (Exception e ) {
143146 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+ }
144153 }
145154 }
146155
You can’t perform that action at this time.
0 commit comments