File tree Expand file tree Collapse file tree 1 file changed +2
-1
lines changed
wrapper/src/main/java/software/amazon/jdbc/plugin/efm2 Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Original file line number Diff line number Diff line change @@ -52,6 +52,7 @@ public class HostMonitorImpl extends AbstractMonitor implements HostMonitor {
5252 private static final long THREAD_SLEEP_NANO = TimeUnit .MILLISECONDS .toNanos (100 );
5353 private static final long TERMINATION_TIMEOUT_SEC = 30 ;
5454 private static final String MONITORING_PROPERTY_PREFIX = "monitoring-" ;
55+ private static final int MIN_VALIDITY_CHECK_TIMEOUT_SEC = 1 ;
5556
5657 protected static final Executor ABORT_EXECUTOR =
5758 ExecutorFactory .newSingleThreadExecutor ("abort" );
@@ -324,7 +325,7 @@ boolean checkConnectionStatus() {
324325 final int validTimeout = (int ) TimeUnit .NANOSECONDS .toSeconds (
325326 this .failureDetectionIntervalNano - THREAD_SLEEP_NANO ) / 2 ;
326327 // validTimeout could get rounded down to 0.
327- return this .monitoringConn .isValid (Math .max (1 , validTimeout ));
328+ return this .monitoringConn .isValid (Math .max (MIN_VALIDITY_CHECK_TIMEOUT_SEC , validTimeout ));
328329 } catch (final SQLException sqlEx ) {
329330 return false ;
330331 } finally {
You can’t perform that action at this time.
0 commit comments