You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@james.apache.org by "hungphan227 (via GitHub)" <gi...@apache.org> on 2024/05/04 09:59:29 UTC

[PR] JAMES-3693 Enable automatic update of redis cluster change [james-project]

hungphan227 opened a new pull request, #2229:
URL: https://github.com/apache/james-project/pull/2229

   https://github.com/linagora/james-project/issues/5171


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] JAMES-3693 Enable automatic update of redis cluster change [james-project]

Posted by "vttranlina (via GitHub)" <gi...@apache.org>.
vttranlina commented on code in PR #2229:
URL: https://github.com/apache/james-project/pull/2229#discussion_r1593292320


##########
server/mailet/rate-limiter-redis/src/main/scala/org/apache/james/rate/limiter/redis/RedisRateLimiter.scala:
##########
@@ -63,8 +62,8 @@ class RedisRateLimiterFactory @Inject()(redisConfiguration: RedisConfiguration)
       val resourceBuilder = ClientResources.builder()
         .threadFactoryProvider(poolName => NamedThreadFactory.withName(s"redis-driver-$poolName"))
       redisConfiguration.ioThreads.foreach(value => resourceBuilder.ioThreadPoolSize(value))
-      redisConfiguration.workerThreads.foreach(value =>resourceBuilder.computationThreadPoolSize(value))
-      new RedisClusterRateLimiterFactory(RedisClusterClient.create(resourceBuilder.build(),
+      redisConfiguration.workerThreads.foreach(value => resourceBuilder.computationThreadPoolSize(value))
+      new RedisClusterRateLimiterFactory(RedisUtils.createRedisClusterClient(resourceBuilder.build(),

Review Comment:
   rebase PR to avoid conflict 
   https://github.com/apache/james-project/pull/2224



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] JAMES-3693 Enable automatic update of redis cluster change [james-project]

Posted by "quantranhong1999 (via GitHub)" <gi...@apache.org>.
quantranhong1999 commented on code in PR #2229:
URL: https://github.com/apache/james-project/pull/2229#discussion_r1589956721


##########
backends-common/redis/src/main/java/org/apache/james/backends/redis/RedisUtils.java:
##########
@@ -0,0 +1,48 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information        *
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the            *
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *                                                              *
+ *   http://www.apache.org/licenses/LICENSE-2.0                 *
+ *                                                              *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
+ * KIND, either express or implied.  See the License for the    *
+ * specific language governing permissions and limitations      *
+ * under the License.                                           *
+ ****************************************************************/
+
+package org.apache.james.backends.redis;
+
+import java.util.List;
+
+import io.lettuce.core.RedisURI;
+import io.lettuce.core.cluster.ClusterClientOptions;
+import io.lettuce.core.cluster.ClusterTopologyRefreshOptions;
+import io.lettuce.core.cluster.RedisClusterClient;
+import io.lettuce.core.resource.ClientResources;
+
+public class RedisUtils {
+    public static RedisClusterClient createRedisClusterClient(ClientResources clientResources, List<RedisURI> redisURI) {
+        ClusterTopologyRefreshOptions topologyRefreshOptions = ClusterTopologyRefreshOptions.builder()
+            .enableAllAdaptiveRefreshTriggers()

Review Comment:
   How does this behave compared to the explicitly Master/Replica topology declaration? Which is better?



##########
server/mailet/rate-limiter-redis/src/main/scala/org/apache/james/rate/limiter/redis/RedisRateLimiter.scala:
##########
@@ -63,8 +62,8 @@ class RedisRateLimiterFactory @Inject()(redisConfiguration: RedisConfiguration)
       val resourceBuilder = ClientResources.builder()
         .threadFactoryProvider(poolName => NamedThreadFactory.withName(s"redis-driver-$poolName"))
       redisConfiguration.ioThreads.foreach(value => resourceBuilder.ioThreadPoolSize(value))
-      redisConfiguration.workerThreads.foreach(value =>resourceBuilder.computationThreadPoolSize(value))
-      new RedisClusterRateLimiterFactory(RedisClusterClient.create(resourceBuilder.build(),
+      redisConfiguration.workerThreads.foreach(value => resourceBuilder.computationThreadPoolSize(value))
+      new RedisClusterRateLimiterFactory(RedisUtils.createRedisClusterClient(resourceBuilder.build(),

Review Comment:
   This is not the only place `RedisClusterClient` is being created e.g. `RedisHealthCheck`.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] JAMES-3693 Enable automatic update of redis cluster change [james-project]

Posted by "hungphan227 (via GitHub)" <gi...@apache.org>.
hungphan227 commented on PR #2229:
URL: https://github.com/apache/james-project/pull/2229#issuecomment-2114676748

   I still think the lua script issue relates to this PR. Close for now. I will create another PR in https://github.com/linagora/james-project/issues/5181


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] JAMES-3693 Enable automatic update of redis cluster change [james-project]

Posted by "Arsnael (via GitHub)" <gi...@apache.org>.
Arsnael commented on PR #2229:
URL: https://github.com/apache/james-project/pull/2229#issuecomment-2111503057

   Rebase please :)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] JAMES-3693 Enable automatic update of redis cluster change [james-project]

Posted by "hungphan227 (via GitHub)" <gi...@apache.org>.
hungphan227 closed pull request #2229: JAMES-3693 Enable automatic update of redis cluster change
URL: https://github.com/apache/james-project/pull/2229


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] JAMES-3693 Enable automatic update of redis cluster change [james-project]

Posted by "hungphan227 (via GitHub)" <gi...@apache.org>.
hungphan227 commented on PR #2229:
URL: https://github.com/apache/james-project/pull/2229#issuecomment-2109656835

   This PR is on hold due to the lua script issue


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] JAMES-3693 Enable automatic update of redis cluster change [james-project]

Posted by "hungphan227 (via GitHub)" <gi...@apache.org>.
hungphan227 commented on PR #2229:
URL: https://github.com/apache/james-project/pull/2229#issuecomment-2102149885

   This one is supposed to resolve this ticket https://github.com/linagora/james-project/issues/5181


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] JAMES-3693 Enable automatic update of redis cluster change [james-project]

Posted by "Arsnael (via GitHub)" <gi...@apache.org>.
Arsnael commented on PR #2229:
URL: https://github.com/apache/james-project/pull/2229#issuecomment-2109870246

   Dont think it is a hard blocker either 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] JAMES-3693 Enable automatic update of redis cluster change [james-project]

Posted by "quantranhong1999 (via GitHub)" <gi...@apache.org>.
quantranhong1999 commented on PR #2229:
URL: https://github.com/apache/james-project/pull/2229#issuecomment-2109691594

   > This PR is on hold due to the lua script issue
   
   Is that a blocker?
   Is it not that regardless of this change, the Lua script still fails?
   Maybe let Redis/lettuce refresh the topology change more frequently would mitigate the issue.
   
   BTW rate limit mailet failure (if configure `onMailetException=ignored`) won't fail the mailet pipeline though. Not a big deal IMO.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] JAMES-3693 Enable automatic update of redis cluster change [james-project]

Posted by "Arsnael (via GitHub)" <gi...@apache.org>.
Arsnael commented on PR #2229:
URL: https://github.com/apache/james-project/pull/2229#issuecomment-2106534235

   Still needs to be resolved, and needs a rebase


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] JAMES-3693 Enable automatic update of redis cluster change [james-project]

Posted by "Arsnael (via GitHub)" <gi...@apache.org>.
Arsnael commented on PR #2229:
URL: https://github.com/apache/james-project/pull/2229#issuecomment-2114454389

   @hungphan227 can you please rebase this work?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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