You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@james.apache.org by bt...@apache.org on 2022/08/18 02:01:35 UTC

[james-project] 01/02: JAMES-3800 S3BlobStoreDAO should be explicit upon future cancellation

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

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

commit 3c9c2b3e1f437c80b4ccf1f0b575b24a5960810c
Author: Benoit Tellier <bt...@linagora.com>
AuthorDate: Wed Aug 10 10:26:05 2022 +0700

    JAMES-3800 S3BlobStoreDAO should be explicit upon future cancellation
    
    Previously returned an empty publisher, causing data
     validation issues down the line.
    
     Cause of this error is a XML unmarshalling issue upon
     timeouts upon partial data receival.
    
     This error handling will make James error logs less cryptic and hopefully easier to audit.
    
    (cherry picked from commit 08f30ae5c1663cb273b826771c9b2240410c15d6)
---
 .../java/org/apache/james/blob/objectstorage/aws/S3BlobStoreDAO.java   | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/server/blob/blob-s3/src/main/java/org/apache/james/blob/objectstorage/aws/S3BlobStoreDAO.java b/server/blob/blob-s3/src/main/java/org/apache/james/blob/objectstorage/aws/S3BlobStoreDAO.java
index 66097a93fc..190639f654 100644
--- a/server/blob/blob-s3/src/main/java/org/apache/james/blob/objectstorage/aws/S3BlobStoreDAO.java
+++ b/server/blob/blob-s3/src/main/java/org/apache/james/blob/objectstorage/aws/S3BlobStoreDAO.java
@@ -202,7 +202,8 @@ public class S3BlobStoreDAO implements BlobStoreDAO, Startable, Closeable {
                         response.flux = Flux.from(publisher);
                         response.supportingCompletableFuture.complete(response);
                     }
-                }));
+                }))
+            .switchIfEmpty(Mono.error(() -> new ObjectStoreIOException("Request was unexpectedly canceled, no GetObjectResponse")));
     }
 
 


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