james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From btell...@apache.org
Subject [james-project] 12/12: JAMES-2630 Add logs before connection retries
Date Mon, 18 Feb 2019 08:40:40 GMT
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 439ea3a893c944dad07635e4d85e31d88ead1b28
Author: Benoit Tellier <btellier@linagora.com>
AuthorDate: Thu Feb 14 16:18:47 2019 +0700

    JAMES-2630 Add logs before connection retries
---
 .../org/apache/james/modules/mailbox/ElasticSearchMailboxModule.java     | 1 +
 .../java/org/apache/james/modules/mailbox/ResilientClusterProvider.java  | 1 +
 2 files changed, 2 insertions(+)

diff --git a/server/container/guice/cassandra-guice/src/main/java/org/apache/james/modules/mailbox/ElasticSearchMailboxModule.java
b/server/container/guice/cassandra-guice/src/main/java/org/apache/james/modules/mailbox/ElasticSearchMailboxModule.java
index c838516..c8117bc 100644
--- a/server/container/guice/cassandra-guice/src/main/java/org/apache/james/modules/mailbox/ElasticSearchMailboxModule.java
+++ b/server/container/guice/cassandra-guice/src/main/java/org/apache/james/modules/mailbox/ElasticSearchMailboxModule.java
@@ -141,6 +141,7 @@ public class ElasticSearchMailboxModule extends AbstractModule {
 
         Duration waitDelay = Duration.ofMillis(configuration.getMinDelay());
         return Mono.fromCallable(() -> connectToCluster(configuration, mailboxConfiguration,
quotaConfiguration))
+            .doOnError(e -> LOGGER.warn("Error establishing ElasticSearch connection.
Next retry scheduled in {} ms", waitDelay, e))
             .retryBackoff(configuration.getMaxRetries(), waitDelay, waitDelay)
             .publishOn(Schedulers.elastic())
             .block();
diff --git a/server/container/guice/cassandra-guice/src/main/java/org/apache/james/modules/mailbox/ResilientClusterProvider.java
b/server/container/guice/cassandra-guice/src/main/java/org/apache/james/modules/mailbox/ResilientClusterProvider.java
index 06bfb9b..9ed14c2 100644
--- a/server/container/guice/cassandra-guice/src/main/java/org/apache/james/modules/mailbox/ResilientClusterProvider.java
+++ b/server/container/guice/cassandra-guice/src/main/java/org/apache/james/modules/mailbox/ResilientClusterProvider.java
@@ -50,6 +50,7 @@ public class ResilientClusterProvider implements Provider<Cluster>
{
     private ResilientClusterProvider(ClusterConfiguration configuration) {
         Duration waitDelay = Duration.ofMillis(configuration.getMinDelay());
         cluster = Mono.fromCallable(getClusterRetryCallable(configuration))
+            .doOnError(e -> LOGGER.warn("Error establishing Cassandra connection. Next
retry scheduled in {} ms", waitDelay, e))
             .retryBackoff(configuration.getMaxRetry(), waitDelay, waitDelay)
             .publishOn(Schedulers.elastic())
             .block();


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


Mime
View raw message