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.
  • Loading branch information
Thom-x authored Feb 6, 2025
1 parent 51ad920 commit 1c1d687
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,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 1c1d687

Please sign in to comment.