You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by bt...@apache.org on 2019/06/26 03:28:51 UTC
[james-project] 11/28: JAMES-2794 Avoid calling *block* in doOnNext
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 9e9e93522991e53bd3980e952d2dd8300e9644bc
Author: Benoit Tellier <bt...@linagora.com>
AuthorDate: Tue Jun 18 14:24:59 2019 +0700
JAMES-2794 Avoid calling *block* in doOnNext
Reactor is complaining that block was called in a parallel thread around 4-8%
of the time. Switching the subscription scheduler did not modify this behaviour.
However, we do not need to actually wait the browse update to be performed
before returning: this can perfectly be a background process.
This actually solves stability issues of browseAndDequeueShouldCombineWellWhenDifferentSlices
---
.../queue/rabbitmq/view/cassandra/CassandraMailQueueMailDelete.java | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/server/queue/queue-rabbitmq/src/main/java/org/apache/james/queue/rabbitmq/view/cassandra/CassandraMailQueueMailDelete.java b/server/queue/queue-rabbitmq/src/main/java/org/apache/james/queue/rabbitmq/view/cassandra/CassandraMailQueueMailDelete.java
index 55d563a..b326eb4 100644
--- a/server/queue/queue-rabbitmq/src/main/java/org/apache/james/queue/rabbitmq/view/cassandra/CassandraMailQueueMailDelete.java
+++ b/server/queue/queue-rabbitmq/src/main/java/org/apache/james/queue/rabbitmq/view/cassandra/CassandraMailQueueMailDelete.java
@@ -29,6 +29,7 @@ import org.apache.james.queue.rabbitmq.MailQueueName;
import org.apache.james.queue.rabbitmq.view.cassandra.configuration.CassandraMailQueueViewConfiguration;
import reactor.core.publisher.Mono;
+import reactor.core.scheduler.Schedulers;
public class CassandraMailQueueMailDelete {
@@ -61,7 +62,8 @@ public class CassandraMailQueueMailDelete {
void updateBrowseStart(MailQueueName mailQueueName) {
findNewBrowseStart(mailQueueName)
.flatMap(newBrowseStart -> updateNewBrowseStart(mailQueueName, newBrowseStart))
- .block();
+ .subscribeOn(Schedulers.elastic())
+ .subscribe();
}
private void maybeUpdateBrowseStart(MailQueueName mailQueueName) {
---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org