This is an automated email from the ASF dual-hosted git repository.

btellier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git

commit 7dcfbec549bb31735fa7770e793256b087d21b50
Author: Benoit TELLIER <btell...@linagora.com>
AuthorDate: Wed Feb 26 08:55:11 2025 +0100

    [FIX] MimeMessage partial loading should not cause leak
---
 .../blob-common/src/main/java/org/apache/james/blob/api/Store.java     | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git 
a/server/blob/blob-common/src/main/java/org/apache/james/blob/api/Store.java 
b/server/blob/blob-common/src/main/java/org/apache/james/blob/api/Store.java
index b461751305..6f64563779 100644
--- a/server/blob/blob-common/src/main/java/org/apache/james/blob/api/Store.java
+++ b/server/blob/blob-common/src/main/java/org/apache/james/blob/api/Store.java
@@ -111,7 +111,8 @@ public interface Store<T, I> {
                 // Critical to correctly propagate errors.
                 // Replacing by `map` would cause the error not to be catch 
downstream. No idea why, failed to reproduce with a test.
                 // Impact: unacknowledged messages for RabbitMQ mailQueue that 
eventually piles up to interruption of service.
-                .flatMap(e -> Mono.fromCallable(() -> decoder.decode(e))
+                .flatMap(streams -> Mono.fromCallable(() -> 
decoder.decode(streams))
+                    .doOnError(e -> 
streams.forEach(Throwing.biConsumer((blobType, byteSource) -> 
byteSource.close())))
                     .subscribeOn(ReactorUtils.BLOCKING_CALL_WRAPPER));
         }
 


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscr...@james.apache.org
For additional commands, e-mail: notifications-h...@james.apache.org

Reply via email to