diff --git a/core/docker/default/etc/jvm.config b/core/docker/default/etc/jvm.config index 0a6bca1bc2f..9d1a5afd54d 100644 --- a/core/docker/default/etc/jvm.config +++ b/core/docker/default/etc/jvm.config @@ -17,3 +17,7 @@ -XX:GCLockerRetryAllocationCount=32 # Allow loading dynamic agent used by JOL -XX:+EnableDynamicAgentLoading +# Trino server behavior does generally not depend on locale settings. +# Use en_US as this is what Trino is tested with. +-Duser.language=en +-Duser.region=US diff --git a/core/trino-main/src/main/java/io/trino/server/TrinoSystemRequirements.java b/core/trino-main/src/main/java/io/trino/server/TrinoSystemRequirements.java index d3ec3cba179..462cc7bdb33 100644 --- a/core/trino-main/src/main/java/io/trino/server/TrinoSystemRequirements.java +++ b/core/trino-main/src/main/java/io/trino/server/TrinoSystemRequirements.java @@ -39,6 +39,7 @@ final class TrinoSystemRequirements { private static final int MIN_FILE_DESCRIPTORS = 4096; private static final int RECOMMENDED_FILE_DESCRIPTORS = 8192; + private static final Locale EN_US = Locale.of("en", "US"); private TrinoSystemRequirements() {} @@ -52,6 +53,7 @@ public static void verifyJvmRequirements() verifyFileDescriptor(); verifySlice(); verifyUtf8(); + verifyLocale(); } private static void verify64BitJvm() @@ -162,6 +164,14 @@ private static void verifyUtf8() } } + private static void verifyLocale() + { + Locale defaultLocale = Locale.getDefault(); + if (!defaultLocale.equals(EN_US)) { + failRequirement("Trino requires that the default locale is ENGLISH (found %s). This can be set with the JVM command line option -Duser.language=en -Duser.region=US", defaultLocale); + } + } + /** * Perform a sanity check to make sure that the year is reasonably current, to guard against * issues in third party libraries. diff --git a/core/trino-server-rpm/src/main/resources/dist/config/jvm.config b/core/trino-server-rpm/src/main/resources/dist/config/jvm.config index f9d739fbd3a..49bf611a9e9 100644 --- a/core/trino-server-rpm/src/main/resources/dist/config/jvm.config +++ b/core/trino-server-rpm/src/main/resources/dist/config/jvm.config @@ -16,3 +16,7 @@ -XX:GCLockerRetryAllocationCount=32 # Allow loading dynamic agent used by JOL -XX:+EnableDynamicAgentLoading +# Trino server behavior does generally not depend on locale settings. +# Use en_US as this is what Trino is tested with. +-Duser.language=en +-Duser.region=US diff --git a/docs/src/main/sphinx/installation/deployment.md b/docs/src/main/sphinx/installation/deployment.md index 71514738ba6..9ec52368280 100644 --- a/docs/src/main/sphinx/installation/deployment.md +++ b/docs/src/main/sphinx/installation/deployment.md @@ -147,6 +147,10 @@ The following provides a good starting point for creating `etc/jvm.config`: -XX:GCLockerRetryAllocationCount=32 # Allow loading dynamic agent used by JOL -XX:+EnableDynamicAgentLoading +# Trino server behavior does generally not depend on locale settings. +# Use en_US as this is what Trino is tested with. +-Duser.language=en +-Duser.region=US ``` You must adjust the value for the memory used by Trino, specified with `-Xmx` diff --git a/testing/trino-product-tests-launcher/src/main/resources/docker/presto-product-tests/conf/environment/multinode-all/jvm.config b/testing/trino-product-tests-launcher/src/main/resources/docker/presto-product-tests/conf/environment/multinode-all/jvm.config index 13a9f69d585..67e8936000b 100644 --- a/testing/trino-product-tests-launcher/src/main/resources/docker/presto-product-tests/conf/environment/multinode-all/jvm.config +++ b/testing/trino-product-tests-launcher/src/main/resources/docker/presto-product-tests/conf/environment/multinode-all/jvm.config @@ -17,3 +17,7 @@ -XX:ErrorFile=/docker/logs/product-tests-presto-jvm-error-file.log # Allow loading dynamic agent used by JOL -XX:+EnableDynamicAgentLoading +# Trino server behavior does generally not depend on locale settings. +# Use en_US as this is what Trino is tested with. +-Duser.language=en +-Duser.region=US diff --git a/testing/trino-product-tests-launcher/src/main/resources/docker/presto-product-tests/conf/presto/etc/jvm.config b/testing/trino-product-tests-launcher/src/main/resources/docker/presto-product-tests/conf/presto/etc/jvm.config index 313933a433b..95aab794828 100644 --- a/testing/trino-product-tests-launcher/src/main/resources/docker/presto-product-tests/conf/presto/etc/jvm.config +++ b/testing/trino-product-tests-launcher/src/main/resources/docker/presto-product-tests/conf/presto/etc/jvm.config @@ -16,3 +16,7 @@ -XX:ErrorFile=/docker/logs/product-tests-presto-jvm-error-file.log # Allow loading dynamic agent used by JOL -XX:+EnableDynamicAgentLoading +# Trino server behavior does generally not depend on locale settings. +# Use en_US as this is what Trino is tested with. +-Duser.language=en +-Duser.region=US