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 ro...@apache.org on 2019/10/16 12:43:06 UTC

[james-project] branch master updated (b42a7da -> e6cf012)

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

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


    from b42a7da  JAMES-2704 Random storing can leave some mailboxes empty
     new 70fd3f1  JAMES-2813 plug Schedulers leaks
     new e6cf012  JAMES-2909 Use Architecture Decision Record

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:
 .adr-dir                                           |  1 +
 README.adoc                                        |  4 +++
 .../distributed/RabbitMQTerminationSubscriber.java | 10 ++++--
 .../distributed/RabbitMQWorkQueue.java             | 13 ++++++--
 src/adr/0001-record-architecture-decisions.md      | 38 ++++++++++++++++++++++
 5 files changed, 60 insertions(+), 6 deletions(-)
 create mode 100644 .adr-dir
 create mode 100644 src/adr/0001-record-architecture-decisions.md


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


[james-project] 02/02: JAMES-2909 Use Architecture Decision Record

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit e6cf0120435828c768eaaa45dd1aa313d8153491
Author: Gautier DI FOLCO <gd...@linagora.com>
AuthorDate: Wed Oct 2 11:17:36 2019 +0200

    JAMES-2909 Use Architecture Decision Record
---
 .adr-dir                                      |  1 +
 README.adoc                                   |  4 +++
 src/adr/0001-record-architecture-decisions.md | 38 +++++++++++++++++++++++++++
 3 files changed, 43 insertions(+)

diff --git a/.adr-dir b/.adr-dir
new file mode 100644
index 0000000..bbdb643
--- /dev/null
+++ b/.adr-dir
@@ -0,0 +1 @@
+src/adr
diff --git a/README.adoc b/README.adoc
index 2bc2c8c..e415774 100644
--- a/README.adoc
+++ b/README.adoc
@@ -55,6 +55,7 @@ There is many other ways one can help us: packaging, communication, etc ...
  ** https://github.com/apache/james-project/#how-to-retrieve-users-and-password-from-my-previous-container[How to retrieve users and password from my previous container?]
  ** https://github.com/apache/james-project/#how-to-run-deployment-tests[How to run deployment Tests]
  * https://github.com/apache/james-project/#generating-a-package-for-james[Generating a package for James]
+ * https://github.com/apache/james-project/#know-more-about-james[Know more about James]
 
 == How to try James
 
@@ -563,3 +564,6 @@ Once installed, try:
 
 By default James is configured without LDAP support.
 
+= Know more about James
+
+James comes with a https://james.apache.org/documentation.html[Documentation] and https://github.com/linagora/james-project/tree/master/src/adr[Architectural Decision Records].
diff --git a/src/adr/0001-record-architecture-decisions.md b/src/adr/0001-record-architecture-decisions.md
new file mode 100644
index 0000000..fa8e0c1
--- /dev/null
+++ b/src/adr/0001-record-architecture-decisions.md
@@ -0,0 +1,38 @@
+# 1. [JAMES-2909] Record architecture decisions
+
+Date: 2019-10-02
+
+## Status
+
+Proposed
+
+## Context
+
+In order to be more community-oriented, we should adopt a process to have a structured way to have open architectural decisions.
+
+Using an Architectural Decision Records-based process as a support of discussion on the developers mailing-lists.
+
+## Decision
+
+We will use Architecture Decision Records, as [described by Michael Nygard](https://web.archive.org/web/20190824074401/http://thinkrelevance.com/blog/2011/11/15/documenting-architecture-decisions).
+
+Each ADR will be discussed on the Apache James' developers mailing-list before being accepted.
+
+Following [Apache Decision Making process](https://community.apache.org/committers/decisionMaking.html), we provide the following possible status, with their associated meaning:
+ - `Proposed`: The decision is being discussed on the mailing list.
+ - `Accepted (lazy consensus)` : the architecture decision was proposed on the mailing list, and a consensus emerged from people involved in the discussion on the mailing list.
+ - `Accepted (voted)` : the architecture undergo a voting process.
+ - `Rejected` : Consensus built up against that proposal.
+
+
+## Consequences
+
+See Michael Nygard's article, linked above. For a lightweight ADR toolset, see Nat Pryce's [adr-tools](https://github.com/npryce/adr-tools).
+
+We should provide in a mutable `References` section links to related JIRA meta-ticket (not necessarily to all related sub-tickets) as well as a link to the mail archive discussion thread.
+
+JIRA tickets implementing that architecture decision should also link the related Architecture Decision Record.
+
+## References
+
+ * [JAMES-2909](https://jira.apache.org/jira/browse/JAMES-2909)


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


[james-project] 01/02: JAMES-2813 plug Schedulers leaks

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 70fd3f15fccfc427b7722b764ebf3918eeba9e64
Author: Matthieu Baechler <ma...@apache.org>
AuthorDate: Mon Oct 14 16:49:57 2019 +0200

    JAMES-2813 plug Schedulers leaks
---
 .../distributed/RabbitMQTerminationSubscriber.java          | 10 +++++++---
 .../task/eventsourcing/distributed/RabbitMQWorkQueue.java   | 13 ++++++++++---
 2 files changed, 17 insertions(+), 6 deletions(-)

diff --git a/server/task/task-distributed/src/main/java/org/apache/james/task/eventsourcing/distributed/RabbitMQTerminationSubscriber.java b/server/task/task-distributed/src/main/java/org/apache/james/task/eventsourcing/distributed/RabbitMQTerminationSubscriber.java
index 0d97c2b..d2bdeeb 100644
--- a/server/task/task-distributed/src/main/java/org/apache/james/task/eventsourcing/distributed/RabbitMQTerminationSubscriber.java
+++ b/server/task/task-distributed/src/main/java/org/apache/james/task/eventsourcing/distributed/RabbitMQTerminationSubscriber.java
@@ -71,6 +71,8 @@ public class RabbitMQTerminationSubscriber implements TerminationSubscriber, Sta
     private DirectProcessor<Event> listener;
     private Disposable sendQueueHandle;
     private Disposable listenQueueHandle;
+    private Receiver listenerReceiver;
+    private Sender sender;
 
     @Inject
     public RabbitMQTerminationSubscriber(SimpleConnectionPool simpleConnectionPool, JsonEventSerializer serializer) {
@@ -81,7 +83,7 @@ public class RabbitMQTerminationSubscriber implements TerminationSubscriber, Sta
     }
 
     public void start() {
-        Sender sender = channelPool.createSender();
+        sender = channelPool.createSender();
 
         sender.declareExchange(ExchangeSpecification.exchange(EXCHANGE_NAME)).block();
         sender.declare(QueueSpecification.queue(queueName).durable(false).autoDelete(true)).block();
@@ -92,9 +94,9 @@ public class RabbitMQTerminationSubscriber implements TerminationSubscriber, Sta
             .subscribeOn(Schedulers.boundedElastic())
             .subscribe();
 
-        Receiver receiver = RabbitFlux.createReceiver(new ReceiverOptions().connectionMono(connectionMono));
+        listenerReceiver = RabbitFlux.createReceiver(new ReceiverOptions().connectionMono(connectionMono));
         listener = DirectProcessor.create();
-        listenQueueHandle = receiver
+        listenQueueHandle = listenerReceiver
             .consumeAutoAck(queueName)
             .subscribeOn(Schedulers.boundedElastic())
             .concatMap(this::toEvent)
@@ -135,6 +137,8 @@ public class RabbitMQTerminationSubscriber implements TerminationSubscriber, Sta
     public void close() {
         Optional.ofNullable(sendQueueHandle).ifPresent(Disposable::dispose);
         Optional.ofNullable(listenQueueHandle).ifPresent(Disposable::dispose);
+        Optional.ofNullable(listenerReceiver).ifPresent(Receiver::close);
+        Optional.ofNullable(sender).ifPresent(Sender::close);
         channelPool.close();
     }
 }
diff --git a/server/task/task-distributed/src/main/java/org/apache/james/task/eventsourcing/distributed/RabbitMQWorkQueue.java b/server/task/task-distributed/src/main/java/org/apache/james/task/eventsourcing/distributed/RabbitMQWorkQueue.java
index 5516112..e736798 100644
--- a/server/task/task-distributed/src/main/java/org/apache/james/task/eventsourcing/distributed/RabbitMQWorkQueue.java
+++ b/server/task/task-distributed/src/main/java/org/apache/james/task/eventsourcing/distributed/RabbitMQWorkQueue.java
@@ -52,6 +52,7 @@ import reactor.rabbitmq.ExchangeSpecification;
 import reactor.rabbitmq.OutboundMessage;
 import reactor.rabbitmq.QueueSpecification;
 import reactor.rabbitmq.RabbitFlux;
+import reactor.rabbitmq.Receiver;
 import reactor.rabbitmq.ReceiverOptions;
 import reactor.rabbitmq.Sender;
 
@@ -79,6 +80,8 @@ public class RabbitMQWorkQueue implements WorkQueue, Startable {
     private Disposable sendCancelRequestsQueueHandle;
     private Disposable receiverHandle;
     private Disposable cancelRequestListenerHandle;
+    private Sender cancelRequestSender;
+    private Receiver cancelRequestListener;
 
     public RabbitMQWorkQueue(TaskManagerWorker worker, SimpleConnectionPool simpleConnectionPool, JsonTaskSerializer taskSerializer) {
         this.worker = worker;
@@ -140,7 +143,7 @@ public class RabbitMQWorkQueue implements WorkQueue, Startable {
     }
 
     void listenToCancelRequests() {
-        Sender cancelRequestSender = channelPool.createSender();
+        cancelRequestSender = channelPool.createSender();
         String queueName = CANCEL_REQUESTS_QUEUE_NAME_PREFIX + UUID.randomUUID().toString();
 
         cancelRequestSender.declareExchange(ExchangeSpecification.exchange(CANCEL_REQUESTS_EXCHANGE_NAME)).block();
@@ -156,8 +159,9 @@ public class RabbitMQWorkQueue implements WorkQueue, Startable {
     }
 
     private void registerCancelRequestsListener(String queueName) {
-        cancelRequestListenerHandle = RabbitFlux
-            .createReceiver(new ReceiverOptions().connectionMono(connectionMono))
+        cancelRequestListener = RabbitFlux
+            .createReceiver(new ReceiverOptions().connectionMono(connectionMono));
+        cancelRequestListenerHandle = cancelRequestListener
             .consumeAutoAck(queueName)
             .subscribeOn(Schedulers.boundedElastic())
             .map(this::readCancelRequestMessage)
@@ -201,6 +205,9 @@ public class RabbitMQWorkQueue implements WorkQueue, Startable {
         Optional.ofNullable(receiver).ifPresent(RabbitMQExclusiveConsumer::close);
         Optional.ofNullable(sendCancelRequestsQueueHandle).ifPresent(Disposable::dispose);
         Optional.ofNullable(cancelRequestListenerHandle).ifPresent(Disposable::dispose);
+        Optional.ofNullable(sender).ifPresent(Sender::close);
+        Optional.ofNullable(cancelRequestSender).ifPresent(Sender::close);
+        Optional.ofNullable(cancelRequestListener).ifPresent(Receiver::close);
         channelPool.close();
     }
 }


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