From a1a869346ec14995cd46c6e321bc4c7aeaf57ac2 Mon Sep 17 00:00:00 2001 From: Robinson Date: Mon, 20 Feb 2023 19:27:53 +0100 Subject: [PATCH] Updated log messages --- src/dorkbox/network/Client.kt | 14 +++++++------- src/dorkbox/network/aeron/AeronContext.kt | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/dorkbox/network/Client.kt b/src/dorkbox/network/Client.kt index 9be716a0..2141243e 100644 --- a/src/dorkbox/network/Client.kt +++ b/src/dorkbox/network/Client.kt @@ -515,6 +515,12 @@ open class Client( // once we're done with the connection process, stop trying break } catch (e: ClientRetryException) { + if (logger.isTraceEnabled) { + logger.trace(e) { "Unable to connect to $type, retrying..." } + } else { + logger.info { "Unable to connect to $type, retrying..." } + } + handshake.reset() // maybe the aeron driver isn't running? (or isn't running correctly?) @@ -528,12 +534,6 @@ open class Client( // ALSO, we want to make sure we DO NOT approach the linger timeout! sleep(aeronDriver.driverTimeout().coerceAtLeast(TimeUnit.NANOSECONDS.toSeconds(aeronDriver.getLingerNs()*2))) - - if (logger.isTraceEnabled) { - logger.trace(e) { "Unable to connect to $type, retrying..." } - } else { - logger.info { "Unable to connect to $type, retrying..." } - } } catch (e: ClientRejectedException) { aeronDriver.closeIfSingle() // if we are the ONLY instance using the media driver, restart it @@ -582,7 +582,7 @@ open class Client( } // If we did not connect - throw an error. When `client.connect()` is called, either it connects or throws an error - val exception = ClientRejectedException("The server did not respond or permit the connection attempt") + val exception = ClientRejectedException("The server did not respond or permit the connection attempt within $connectionTimeoutSec seconds") ListenerManager.cleanStackTrace(exception) logger.error(exception) { "Aborting connection retry attempt to server." } diff --git a/src/dorkbox/network/aeron/AeronContext.kt b/src/dorkbox/network/aeron/AeronContext.kt index 30d5e53e..dee9143c 100644 --- a/src/dorkbox/network/aeron/AeronContext.kt +++ b/src/dorkbox/network/aeron/AeronContext.kt @@ -184,7 +184,7 @@ class AeronContext( } } - logger.info { "Aeron directory: '${context.aeronDirectory()}'" } + logger.debug { "Aeron directory: '${context.aeronDirectory()}'" } this.context = context }