Skip to content

Commit

Permalink
fix: do not log complete stream. (#2258)
Browse files Browse the repository at this point in the history
Log the hashCode instead of toString to avoid dumping all the file content in memory and in log because of https://github.com/apache/cxf/blob/main/core/src/main/java/org/apache/cxf/io/CachedOutputStream.java#L423
This cause OOM on our app.

(cherry picked from commit 1c1d687)
(cherry picked from commit 24bb53c)
(cherry picked from commit 20cfa99)
  • Loading branch information
Thom-x authored and reta committed Feb 7, 2025
1 parent e7a80e4 commit 8c0fcc5
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ private void clean(Collection<DelayedCloseable> closeables) {
final DelayedCloseable next = iterator.next();
try {
iterator.remove();
LOG.warning("Unclosed (leaked?) stream detected: " + next.closeable);
LOG.warning("Unclosed (leaked?) stream detected: " + next.closeable.hashCode());
next.closeable.close();
} catch (final IOException | RuntimeException ex) {
LOG.warning("Unable to close (leaked?) stream: " + ex.getMessage());
Expand Down

0 comments on commit 8c0fcc5

Please sign in to comment.