From 6685251d341e421bcf4975d7ddee5102c9d28b62 Mon Sep 17 00:00:00 2001 From: Chris Jackson Date: Sun, 12 Jan 2025 19:53:27 +1300 Subject: [PATCH 1/2] Avoid stack overflow - don't log a message within the log handler Signed-off-by: Chris Jackson --- .../java/org/openhab/core/io/websocket/log/LogWebSocket.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bundles/org.openhab.core.io.websocket/src/main/java/org/openhab/core/io/websocket/log/LogWebSocket.java b/bundles/org.openhab.core.io.websocket/src/main/java/org/openhab/core/io/websocket/log/LogWebSocket.java index 64b96623a3a..45c57af007d 100644 --- a/bundles/org.openhab.core.io.websocket/src/main/java/org/openhab/core/io/websocket/log/LogWebSocket.java +++ b/bundles/org.openhab.core.io.websocket/src/main/java/org/openhab/core/io/websocket/log/LogWebSocket.java @@ -128,7 +128,7 @@ public void logged(@NonNullByDefault({}) LogEntry logEntry) { LogDTO logDTO = map(logEntry); sendMessage(gson.toJson(logDTO)); } catch (IOException e) { - logger.debug("Failed to send log {} to {}: {}", logEntry, remoteIdentifier, e.getMessage()); + // Fail silently! } } From 9b859bf998edfbcbf8cda63ac9118b10cbf07a86 Mon Sep 17 00:00:00 2001 From: Chris Jackson Date: Sun, 12 Jan 2025 21:44:05 +1300 Subject: [PATCH 2/2] Don't log error Signed-off-by: Chris Jackson --- .../java/org/openhab/core/io/websocket/log/LogWebSocket.java | 1 - 1 file changed, 1 deletion(-) diff --git a/bundles/org.openhab.core.io.websocket/src/main/java/org/openhab/core/io/websocket/log/LogWebSocket.java b/bundles/org.openhab.core.io.websocket/src/main/java/org/openhab/core/io/websocket/log/LogWebSocket.java index 45c57af007d..939d16cb9c7 100644 --- a/bundles/org.openhab.core.io.websocket/src/main/java/org/openhab/core/io/websocket/log/LogWebSocket.java +++ b/bundles/org.openhab.core.io.websocket/src/main/java/org/openhab/core/io/websocket/log/LogWebSocket.java @@ -113,7 +113,6 @@ public void onError(Session session, @Nullable Throwable error) { 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);