Merge pull request #13709 from smatvienko-tb/hotfix/MqttClient-reduce-log-severity-for-reconnect

Reduced log severity to debug for Scheduling reconnect message to avoid log flood under high-load. Logs are made more informative.
This commit is contained in:
Viacheslav Klimov 2025-07-14 10:29:16 +03:00 committed by GitHub
commit d4ec53aab4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -192,14 +192,14 @@ final class MqttClientImpl implements MqttClient {
}
private void scheduleConnectIfRequired(String host, int port, boolean reconnect) {
log.trace("[{}] Scheduling connect to server, isReconnect - {}", channel != null ? channel.id() : "UNKNOWN", reconnect);
log.trace("[{}][{}][{}] Scheduling connect to server, isReconnect - {}", host, port, channel != null ? channel.id() : "UNKNOWN", reconnect);
if (clientConfig.isReconnect() && !disconnected) {
if (reconnect) {
this.reconnect = true;
}
final long nextReconnectDelay = reconnectStrategy.getNextReconnectDelay();
log.info("[{}] Scheduling reconnect in [{}] sec", channel != null ? channel.id() : "UNKNOWN", nextReconnectDelay);
log.debug("[{}][{}][{}] Scheduling reconnect in [{}] sec", host, port, channel != null ? channel.id() : "UNKNOWN", nextReconnectDelay);
eventLoop.schedule((Runnable) () -> connect(host, port, reconnect), nextReconnectDelay, TimeUnit.SECONDS);
}
}