Skip to content

Commit

Permalink
Set locale to en_US prior to server startup
Browse files Browse the repository at this point in the history
  • Loading branch information
wendigo committed Mar 27, 2024
1 parent 6be48e7 commit 4319903
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions core/trino-main/src/main/java/io/trino/server/Server.java
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
import java.nio.file.Paths;
import java.util.Collection;
import java.util.List;
import java.util.Locale;
import java.util.Optional;
import java.util.Set;

Expand All @@ -95,6 +96,10 @@ public final void start(String trinoVersion)

private void doStart(String trinoVersion)
{
// Trino server behavior does not depend on locale settings.
// Use en_US as this is what Trino is tested with.
Locale.setDefault(Locale.US);

long startTime = System.nanoTime();
verifyJvmRequirements();
verifySystemTimeIsReasonable();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@
import java.time.Instant;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Optional;
import java.util.concurrent.CountDownLatch;
Expand All @@ -152,6 +153,10 @@ public class TestingTrinoServer
Logging logging = Logging.initialize();
logging.setLevel("io.trino.event.QueryMonitor", Level.ERROR);
logging.setLevel("org.eclipse.jetty", Level.ERROR);

// Trino server behavior does not depend on locale settings.
// Use en_US as this is what Trino is tested with.
Locale.setDefault(Locale.US);
}

public static final String SESSION_START_TIME_PROPERTY = "session_start_time";
Expand Down

0 comments on commit 4319903

Please sign in to comment.