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/05/31 08:07:11 UTC

[james-project] branch master updated (9342ae5786 -> 8f0e4d0980)

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

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


    from 9342ae5786 JAMES-3756 Add a piece shows how to add authorized_users column to user table in upgrade-instructions.md
     new 9fb8d76258 JAMES-3772 Close ReactorRabbitMQChannelPool synchronously
     new 8f0e4d0980 JAMES-3772 ReactorRabbitMQChannelPool: get rid of asynchronous release

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../backends/rabbitmq/ReactorRabbitMQChannelPool.java    | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)


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


[james-project] 02/02: JAMES-3772 ReactorRabbitMQChannelPool: get rid of asynchronous release

Posted by bt...@apache.org.
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 8f0e4d0980ed5df759a9e7035e005b549b1e5449
Author: Benoit Tellier <bt...@linagora.com>
AuthorDate: Mon May 30 10:45:29 2022 +0700

    JAMES-3772 ReactorRabbitMQChannelPool: get rid of asynchronous release
---
 .../org/apache/james/backends/rabbitmq/ReactorRabbitMQChannelPool.java  | 2 --
 1 file changed, 2 deletions(-)

diff --git a/backends-common/rabbitmq/src/main/java/org/apache/james/backends/rabbitmq/ReactorRabbitMQChannelPool.java b/backends-common/rabbitmq/src/main/java/org/apache/james/backends/rabbitmq/ReactorRabbitMQChannelPool.java
index 2f255c0592..6167f2740d 100644
--- a/backends-common/rabbitmq/src/main/java/org/apache/james/backends/rabbitmq/ReactorRabbitMQChannelPool.java
+++ b/backends-common/rabbitmq/src/main/java/org/apache/james/backends/rabbitmq/ReactorRabbitMQChannelPool.java
@@ -731,12 +731,10 @@ public class ReactorRabbitMQChannelPool implements ChannelPool, Startable {
 
                 if (!channel.isOpen() || !executeWithoutError(signalType)) {
                     pooledRef.invalidate()
-                        .subscribeOn(Schedulers.elastic())
                         .subscribe();
                     return;
                 }
                 pooledRef.release()
-                    .subscribeOn(Schedulers.elastic())
                     .subscribe();
             });
     }


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


[james-project] 01/02: JAMES-3772 Close ReactorRabbitMQChannelPool synchronously

Posted by bt...@apache.org.
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 9fb8d76258c3e5a3ba1f178fc396837af3b41916
Author: Benoit Tellier <bt...@linagora.com>
AuthorDate: Mon May 30 10:44:14 2022 +0700

    JAMES-3772 Close ReactorRabbitMQChannelPool synchronously
---
 .../backends/rabbitmq/ReactorRabbitMQChannelPool.java      | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/backends-common/rabbitmq/src/main/java/org/apache/james/backends/rabbitmq/ReactorRabbitMQChannelPool.java b/backends-common/rabbitmq/src/main/java/org/apache/james/backends/rabbitmq/ReactorRabbitMQChannelPool.java
index eb2160d8c9..2f255c0592 100644
--- a/backends-common/rabbitmq/src/main/java/org/apache/james/backends/rabbitmq/ReactorRabbitMQChannelPool.java
+++ b/backends-common/rabbitmq/src/main/java/org/apache/james/backends/rabbitmq/ReactorRabbitMQChannelPool.java
@@ -39,7 +39,6 @@ import org.slf4j.LoggerFactory;
 
 import com.github.fge.lambdas.Throwing;
 import com.google.common.base.Preconditions;
-import com.google.common.collect.ImmutableList;
 import com.rabbitmq.client.AMQP;
 import com.rabbitmq.client.BuiltinExchangeType;
 import com.rabbitmq.client.CancelCallback;
@@ -682,7 +681,11 @@ public class ReactorRabbitMQChannelPool implements ChannelPool, Startable {
                 }
                 return false;
             })
-            .destroyHandler(channel -> Mono.fromRunnable(Throwing.runnable(channel::close)))
+            .destroyHandler(channel -> Mono.fromRunnable(Throwing.runnable(() -> {
+                if (channel.isOpen()) {
+                    channel.close();
+                }
+            })))
             .buildPool();
     }
 
@@ -796,10 +799,9 @@ public class ReactorRabbitMQChannelPool implements ChannelPool, Startable {
     @Override
     public void close() {
         sender.close();
-        ImmutableList.copyOf(refs.values())
-            .stream()
-            .map(PooledRef::poolable)
-            .forEach(channel -> getChannelCloseHandler().accept(SignalType.ON_NEXT, channel));
+       Flux.fromIterable(refs.values())
+           .flatMap(PooledRef::invalidate)
+           .blockLast();
         refs.clear();
         newPool.dispose();
     }


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