Skip to content

Commit

Permalink
Avoid stack overflow - don't log a message within the log handler (#4556
Browse files Browse the repository at this point in the history
)

* 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>
  • Loading branch information
cdjackson authored Jan 14, 2025
1 parent 9ad83ba commit 1b203d1
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -128,7 +127,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!
}
}

Expand Down

0 comments on commit 1b203d1

Please sign in to comment.