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/09/01 15:48:15 UTC

[james-project] branch master updated (d489c9bea7 -> b9174ff0c6)

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 d489c9bea7 JAMES-3793 Add a setting to prevent S3BlobStoreDAO load too big objects in memory
     new 2df0d5e9de JAMES-3668 Enhance logging experience for extra properties
     new b9174ff0c6 JAMES-3668 Add absolute paths for extra properties file in docker image

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:
 .../{sample-configuration => docker-configuration}/jvm.properties   | 2 +-
 server/apps/cassandra-app/pom.xml                                   | 1 +
 .../docker-configuration}/jvm.properties                            | 6 +++---
 server/apps/distributed-app/pom.xml                                 | 1 +
 .../{sample-configuration => docker-configuration}/jvm.properties   | 2 +-
 server/apps/distributed-pop3-app/pom.xml                            | 1 +
 .../common/src/main/java/org/apache/james/ExtraProperties.java      | 5 ++---
 7 files changed, 10 insertions(+), 8 deletions(-)
 copy server/apps/cassandra-app/{sample-configuration => docker-configuration}/jvm.properties (97%)
 copy server/apps/{distributed-pop3-app/sample-configuration => distributed-app/docker-configuration}/jvm.properties (98%)
 copy server/apps/distributed-pop3-app/{sample-configuration => docker-configuration}/jvm.properties (98%)


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


[james-project] 01/02: JAMES-3668 Enhance logging experience for extra properties

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 2df0d5e9dede3f0faec19ababc4825229cebe490
Author: Rene Cordier <rc...@linagora.com>
AuthorDate: Tue Aug 30 17:14:38 2022 +0700

    JAMES-3668 Enhance logging experience for extra properties
    
    - Adding an info log when loading extra properties file is a success
    - Removing the if statement in the FileNotFoundException case (I had the case with docker and the default relative path missing and without logs it was not trivial to debug)
---
 .../guice/common/src/main/java/org/apache/james/ExtraProperties.java | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/server/container/guice/common/src/main/java/org/apache/james/ExtraProperties.java b/server/container/guice/common/src/main/java/org/apache/james/ExtraProperties.java
index 3a022fb747..598d3915b6 100644
--- a/server/container/guice/common/src/main/java/org/apache/james/ExtraProperties.java
+++ b/server/container/guice/common/src/main/java/org/apache/james/ExtraProperties.java
@@ -32,10 +32,9 @@ public class ExtraProperties {
         String propsPath = System.getProperty(OVERRIDE_PROPERTY, DEFAULT_PATH);
         try (FileInputStream in = new FileInputStream(propsPath)) {
             System.getProperties().load(in);
+            JamesServerMain.LOGGER.info("Load extra system properties file {}", propsPath);
         } catch (FileNotFoundException e) {
-            if (!DEFAULT_PATH.equals(propsPath)) {
-                JamesServerMain.LOGGER.warn("Could not find extra system properties file {}", propsPath);
-            }
+            JamesServerMain.LOGGER.warn("Could not find extra system properties file {}", propsPath);
         } catch (IOException e) {
             JamesServerMain.LOGGER.warn(
                     "Failed to load extra system properties from file {} : {}", propsPath, e.getMessage());


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


[james-project] 02/02: JAMES-3668 Add absolute paths for extra properties file in docker image

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 b9174ff0c68a6ba3694875691d9cadacc994b966
Author: Rene Cordier <rc...@linagora.com>
AuthorDate: Tue Aug 30 17:16:34 2022 +0700

    JAMES-3668 Add absolute paths for extra properties file in docker image
    
    We had issues with the relative path not working with Docker and James not being able to find the file.
    Overriding to absolute path should ensure it finds it in this particular case.
---
 .../docker-configuration/jvm.properties            | 48 ++++++++++++++++++++++
 server/apps/cassandra-app/pom.xml                  |  1 +
 .../docker-configuration/jvm.properties            | 48 ++++++++++++++++++++++
 server/apps/distributed-app/pom.xml                |  1 +
 .../docker-configuration/jvm.properties            | 48 ++++++++++++++++++++++
 server/apps/distributed-pop3-app/pom.xml           |  1 +
 6 files changed, 147 insertions(+)

diff --git a/server/apps/cassandra-app/docker-configuration/jvm.properties b/server/apps/cassandra-app/docker-configuration/jvm.properties
new file mode 100644
index 0000000000..7e3e6463ef
--- /dev/null
+++ b/server/apps/cassandra-app/docker-configuration/jvm.properties
@@ -0,0 +1,48 @@
+# ============================================= Extra JVM System Properties ===========================================
+# To avoid clutter on the command line, any properties in this file will be added as system properties on server start.
+
+# Example: If you need an option -Dmy.property=whatever, you can instead add it here as
+# my.property=whatever
+
+# Required to locate Cassandra driver configuration
+config.file=/root/conf/cassandra-driver.conf
+
+# (Optional). String (size, integer + size units, example: `12 KIB`, supported units are bytes KIB MIB GIB TIB). Defaults to 100KIB.
+# This governs the threshold MimeMessageInputStreamSource relies on for storing MimeMessage content on disk.
+# Below, data is stored in memory. Above data is stored on disk.
+# Lower values will lead to longer processing time but will minimize heap memory usage. Modern SSD hardware
+# should however support a high throughput. Higher values will lead to faster single mail processing at the cost
+# of higher heap usage.
+#james.message.memory.threshold=12K
+
+# Optional. Boolean. Defaults to false. Recommended value is false.
+# Should MimeMessageWrapper use a copy of the message in memory? Or should bigger message exceeding james.message.memory.threshold
+# be copied to temporary files?
+#james.message.usememorycopy=false
+
+# Mode level of resource leak detection. It is used to detect a resource not be disposed of before it's garbage-collected.
+# Example `MimeMessageInputStreamSource`
+# Optional. Allowed values are: none, simple, advanced, testing
+#   - none: Disables resource leak detection.
+#   - simple: Enables output a simplistic error log if a leak is encountered and would free the resources (default).
+#   - advanced: Enables output an advanced error log implying the place of allocation of the underlying object and would free resources.
+#   - testing: Enables output an advanced error log implying the place of allocation of the underlying object and rethrow an error, that action is being taken by the development team.
+#james.lifecycle.leak.detection.mode=simple
+
+# Should we add the host in the MDC logging context for incoming IMAP, SMTP, POP3? Doing so, a DNS resolution
+# is attempted for each incoming connection, which can be costly. Remote IP is always added to the logging context.
+# Optional. Boolean. Defaults to true.
+#james.protocols.mdc.hostname=true
+
+# Manage netty leak detection level see https://netty.io/wiki/reference-counted-objects.html#leak-detection-levels
+# io.netty.leakDetection.level=SIMPLE
+
+# Should James exit on Startup error? Boolean, defaults to true. This prevents partial startup.
+# james.exit.on.startup.error=true
+
+# Fails explicitly on missing configuration file rather that taking implicit values. Defautls to false.
+# james.fail.on.missing.configuration=true
+
+# JMX, when enable causes RMI to plan System.gc every hour. Set this instead to once every 1000h.
+sun.rmi.dgc.server.gcInterval=3600000000
+sun.rmi.dgc.client.gcInterval=3600000000
\ No newline at end of file
diff --git a/server/apps/cassandra-app/pom.xml b/server/apps/cassandra-app/pom.xml
index aa6ccb50cf..141e33acef 100644
--- a/server/apps/cassandra-app/pom.xml
+++ b/server/apps/cassandra-app/pom.xml
@@ -365,6 +365,7 @@
                             <jvmFlag>-Dworking.directory=/root/</jvmFlag>
                             <!-- Prevents Logjam (CVE-2015-4000) -->
                             <jvmFlag>-Djdk.tls.ephemeralDHKeySize=2048</jvmFlag>
+                            <jvmFlag>-Dextra.props=/root/conf/jvm.properties</jvmFlag>
                         </jvmFlags>
                         <creationTime>USE_CURRENT_TIMESTAMP</creationTime>
 
diff --git a/server/apps/distributed-app/docker-configuration/jvm.properties b/server/apps/distributed-app/docker-configuration/jvm.properties
new file mode 100644
index 0000000000..93165bbf95
--- /dev/null
+++ b/server/apps/distributed-app/docker-configuration/jvm.properties
@@ -0,0 +1,48 @@
+# ============================================= Extra JVM System Properties ===========================================
+# To avoid clutter on the command line, any properties in this file will be added as system properties on server start.
+
+# Required to locate Cassandra driver configuration
+config.file=/root/conf/cassandra-driver.conf
+
+# Example: If you need an option -Dmy.property=whatever, you can instead add it here as
+# my.property=whatever
+
+# (Optional). String (size, integer + size units, example: `12 KIB`, supported units are bytes KIB MIB GIB TIB). Defaults to 100KIB.
+# This governs the threshold MimeMessageInputStreamSource relies on for storing MimeMessage content on disk.
+# Below, data is stored in memory. Above data is stored on disk.
+# Lower values will lead to longer processing time but will minimize heap memory usage. Modern SSD hardware
+# should however support a high throughput. Higher values will lead to faster single mail processing at the cost
+# of higher heap usage.
+#james.message.memory.threshold=12K
+
+# Optional. Boolean. Defaults to false. Recommended value is false.
+# Should MimeMessageWrapper use a copy of the message in memory? Or should bigger message exceeding james.message.memory.threshold
+# be copied to temporary files?
+#james.message.usememorycopy=false
+
+# Mode level of resource leak detection. It is used to detect a resource not be disposed of before it's garbage-collected.
+# Example `MimeMessageInputStreamSource`
+# Optional. Allowed values are: none, simple, advanced, testing
+#   - none: Disables resource leak detection.
+#   - simple: Enables output a simplistic error log if a leak is encountered and would free the resources (default).
+#   - advanced: Enables output an advanced error log implying the place of allocation of the underlying object and would free resources.
+#   - testing: Enables output an advanced error log implying the place of allocation of the underlying object and rethrow an error, that action is being taken by the development team.
+#james.lifecycle.leak.detection.mode=simple
+
+# Should we add the host in the MDC logging context for incoming IMAP, SMTP, POP3? Doing so, a DNS resolution
+# is attempted for each incoming connection, which can be costly. Remote IP is always added to the logging context.
+# Optional. Boolean. Defaults to true.
+#james.protocols.mdc.hostname=true
+
+# Manage netty leak detection level see https://netty.io/wiki/reference-counted-objects.html#leak-detection-levels
+# io.netty.leakDetection.level=SIMPLE
+
+# Should James exit on Startup error? Boolean, defaults to true. This prevents partial startup.
+# james.exit.on.startup.error=true
+
+# Fails explicitly on missing configuration file rather that taking implicit values. Defautls to false.
+# james.fail.on.missing.configuration=true
+
+# JMX, when enable causes RMI to plan System.gc every hour. Set this instead to once every 1000h.
+sun.rmi.dgc.server.gcInterval=3600000000
+sun.rmi.dgc.client.gcInterval=3600000000
diff --git a/server/apps/distributed-app/pom.xml b/server/apps/distributed-app/pom.xml
index e7744bfb6e..c56e7d30e4 100644
--- a/server/apps/distributed-app/pom.xml
+++ b/server/apps/distributed-app/pom.xml
@@ -409,6 +409,7 @@
                             <jvmFlag>-Dworking.directory=/root/</jvmFlag>
                             <!-- Prevents Logjam (CVE-2015-4000) -->
                             <jvmFlag>-Djdk.tls.ephemeralDHKeySize=2048</jvmFlag>
+                            <jvmFlag>-Dextra.props=/root/conf/jvm.properties</jvmFlag>
                         </jvmFlags>
                         <creationTime>USE_CURRENT_TIMESTAMP</creationTime>
                         <volumes>
diff --git a/server/apps/distributed-pop3-app/docker-configuration/jvm.properties b/server/apps/distributed-pop3-app/docker-configuration/jvm.properties
new file mode 100644
index 0000000000..93dedf3ef8
--- /dev/null
+++ b/server/apps/distributed-pop3-app/docker-configuration/jvm.properties
@@ -0,0 +1,48 @@
+# ============================================= Extra JVM System Properties ===========================================
+# To avoid clutter on the command line, any properties in this file will be added as system properties on server start.
+
+# Example: If you need an option -Dmy.property=whatever, you can instead add it here as
+# my.property=whatever
+
+# Required to locate Cassandra driver configuration
+config.file=/root/conf/cassandra-driver.conf
+
+# (Optional). String (size, integer + size units, example: `12 KIB`, supported units are bytes KIB MIB GIB TIB). Defaults to 100KIB.
+# This governs the threshold MimeMessageInputStreamSource relies on for storing MimeMessage content on disk.
+# Below, data is stored in memory. Above data is stored on disk.
+# Lower values will lead to longer processing time but will minimize heap memory usage. Modern SSD hardware
+# should however support a high throughput. Higher values will lead to faster single mail processing at the cost
+# of higher heap usage.
+#james.message.memory.threshold=12K
+
+# Optional. Boolean. Defaults to false. Recommended value is false.
+# Should MimeMessageWrapper use a copy of the message in memory? Or should bigger message exceeding james.message.memory.threshold
+# be copied to temporary files?
+#james.message.usememorycopy=false
+
+# Mode level of resource leak detection. It is used to detect a resource not be disposed of before it's garbage-collected.
+# Example `MimeMessageInputStreamSource`
+# Optional. Allowed values are: none, simple, advanced, testing
+#   - none: Disables resource leak detection.
+#   - simple: Enables output a simplistic error log if a leak is encountered and would free the resources (default).
+#   - advanced: Enables output an advanced error log implying the place of allocation of the underlying object and would free resources.
+#   - testing: Enables output an advanced error log implying the place of allocation of the underlying object and rethrow an error, that action is being taken by the development team.
+#james.lifecycle.leak.detection.mode=simple
+
+# Should we add the host in the MDC logging context for incoming IMAP, SMTP, POP3? Doing so, a DNS resolution
+# is attempted for each incoming connection, which can be costly. Remote IP is always added to the logging context.
+# Optional. Boolean. Defaults to true.
+#james.protocols.mdc.hostname=true
+
+# Manage netty leak detection level see https://netty.io/wiki/reference-counted-objects.html#leak-detection-levels
+# io.netty.leakDetection.level=SIMPLE
+
+# Should James exit on Startup error? Boolean, defaults to true. This prevents partial startup.
+# james.exit.on.startup.error=true
+
+# Fails explicitly on missing configuration file rather that taking implicit values. Defautls to false.
+# james.fail.on.missing.configuration=true
+
+# JMX, when enable causes RMI to plan System.gc every hour. Set this instead to once every 1000h.
+sun.rmi.dgc.server.gcInterval=3600000000
+sun.rmi.dgc.client.gcInterval=3600000000
diff --git a/server/apps/distributed-pop3-app/pom.xml b/server/apps/distributed-pop3-app/pom.xml
index de4be7816b..cf9e81bf53 100644
--- a/server/apps/distributed-pop3-app/pom.xml
+++ b/server/apps/distributed-pop3-app/pom.xml
@@ -418,6 +418,7 @@
                         <jvmFlags>
                             <jvmFlag>-Dlogback.configurationFile=/root/conf/logback.xml</jvmFlag>
                             <jvmFlag>-Dworking.directory=/root/</jvmFlag>
+                            <jvmFlag>-Dextra.props=/root/conf/jvm.properties</jvmFlag>
                         </jvmFlags>
                         <creationTime>USE_CURRENT_TIMESTAMP</creationTime>
                         <volumes>


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