This is an automated email from the ASF dual-hosted git repository.
reta pushed a commit to branch 4.0.x-fixes
in repository https://gitbox.apache.org/repos/asf/cxf.git
The following commit(s) were added to refs/heads/4.0.x-fixes by this push:
new 24bb53c04c fix: do not log complete stream. (#2258)
24bb53c04c is described below
commit 24bb53c04c2385ddae2908f27614e0c61d675a2c
Author: MAUGIN Thomas <[email protected]>
AuthorDate: Thu Feb 6 19:27:09 2025 +0100
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.
(cherry picked from commit 1c1d687f8e295f433a3592a3bc0b0a63c432bfde)
---
.../main/java/org/apache/cxf/io/DelayedCachedOutputStreamCleaner.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git
a/core/src/main/java/org/apache/cxf/io/DelayedCachedOutputStreamCleaner.java
b/core/src/main/java/org/apache/cxf/io/DelayedCachedOutputStreamCleaner.java
index cb4f9ba880..5c8a176814 100644
--- a/core/src/main/java/org/apache/cxf/io/DelayedCachedOutputStreamCleaner.java
+++ b/core/src/main/java/org/apache/cxf/io/DelayedCachedOutputStreamCleaner.java
@@ -119,7 +119,7 @@ public final class DelayedCachedOutputStreamCleaner
implements CachedOutputStrea
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());