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


The following commit(s) were added to refs/heads/master by this push:
     new f4d6947383 [FIX] DistributedDeletedMessageVaultDeletionCallback: add 
an applicative timeout before RabbitMQ consumer timeout
f4d6947383 is described below

commit f4d69473838b9976c54dc4bb79e61e6e4e89dd66
Author: Benoit TELLIER <[email protected]>
AuthorDate: Tue Dec 3 15:49:06 2024 +0100

    [FIX] DistributedDeletedMessageVaultDeletionCallback: add an applicative 
timeout before RabbitMQ consumer timeout
    
    RabbitMQ default consumer timeout is 30 minutes and kill
    the consumer, thus stopping progress. The applicative
    timeout acts as a defense to prevent this unwanted,
    extreme and harmful default behaviour with RabbitMQ.
---
 .../modules/mailbox/DistributedDeletedMessageVaultDeletionCallback.java | 2 ++
 1 file changed, 2 insertions(+)

diff --git 
a/server/container/guice/distributed/src/main/java/org/apache/james/modules/mailbox/DistributedDeletedMessageVaultDeletionCallback.java
 
b/server/container/guice/distributed/src/main/java/org/apache/james/modules/mailbox/DistributedDeletedMessageVaultDeletionCallback.java
index d0e1c4571b..6be7246339 100644
--- 
a/server/container/guice/distributed/src/main/java/org/apache/james/modules/mailbox/DistributedDeletedMessageVaultDeletionCallback.java
+++ 
b/server/container/guice/distributed/src/main/java/org/apache/james/modules/mailbox/DistributedDeletedMessageVaultDeletionCallback.java
@@ -26,6 +26,7 @@ import static 
org.apache.james.backends.rabbitmq.Constants.DURABLE;
 import static org.apache.james.backends.rabbitmq.Constants.EMPTY_ROUTING_KEY;
 import static org.apache.james.backends.rabbitmq.Constants.EXCLUSIVE;
 
+import java.time.Duration;
 import java.util.Date;
 import java.util.Optional;
 
@@ -232,6 +233,7 @@ public class DistributedDeletedMessageVaultDeletionCallback 
implements DeleteMes
             CopyCommandDTO copyCommandDTO = 
objectMapper.readValue(delivery.getBody(), CopyCommandDTO.class);
 
             return callback.forMessage(copyCommandDTO.asPojo(mailboxIdFactory, 
messageIdFactory, blobIdFactory))
+                .timeout(Duration.ofMinutes(5))
                 .doOnError(e -> {
                     LOGGER.error("Failed executing deletion callback for {}", 
copyCommandDTO.messageId, e);
                     delivery.nack(REQUEUE);


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to