Skip to content

Commit 1c1d687

Browse files
authored
fix: do not log complete stream. (#2258)
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.
1 parent 51ad920 commit 1c1d687

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

core/src/main/java/org/apache/cxf/io/DelayedCachedOutputStreamCleaner.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ private void clean(Collection<DelayedCloseable> closeables) {
119119
final DelayedCloseable next = iterator.next();
120120
try {
121121
iterator.remove();
122-
LOG.warning("Unclosed (leaked?) stream detected: " + next.closeable);
122+
LOG.warning("Unclosed (leaked?) stream detected: " + next.closeable.hashCode());
123123
next.closeable.close();
124124
} catch (final IOException | RuntimeException ex) {
125125
LOG.warning("Unable to close (leaked?) stream: " + ex.getMessage());

0 commit comments

Comments
 (0)