Avoid stack overflow - don't log a message within the log handler (#4556)

* Avoid stack overflow - don't log a message within the log handler

Signed-off-by: Chris Jackson <chris@cd-jackson.com>

* Don't log error

Signed-off-by: Chris Jackson <chris@cd-jackson.com>

---------

Signed-off-by: Chris Jackson <chris@cd-jackson.com>
pull/4463/merge
Chris Jackson 2025-01-14 21:07:25 +13:00 committed by GitHub
parent 9ad83bada4
commit 1b203d1b79
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 2 deletions

View File

@ -113,7 +113,6 @@ public class LogWebSocket implements LogListener {
private synchronized void sendMessage(String message) throws IOException {
RemoteEndpoint remoteEndpoint = this.remoteEndpoint;
if (remoteEndpoint == null) {
logger.warn("Could not determine remote endpoint, failed to send '{}'.", message);
return;
}
remoteEndpoint.sendString(message);
@ -128,7 +127,7 @@ public class LogWebSocket implements LogListener {
LogDTO logDTO = map(logEntry);
sendMessage(gson.toJson(logDTO));
} catch (IOException e) {
logger.debug("Failed to send log {} to {}: {}", logEntry, remoteIdentifier, e.getMessage());
// Fail silently!
}
}