From e6e25f179e3d8cf26e5ef002fefcab858288b71a Mon Sep 17 00:00:00 2001 From: Piotr Findeisen Date: Thu, 23 Mar 2023 10:19:47 +0100 Subject: [PATCH 1/3] Set thread name for DDL queries Before the change, the DDL tasks where being executed with a thread name of `dispatch-query-%d`. --- .../src/main/java/io/trino/execution/SqlQueryManager.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/trino-main/src/main/java/io/trino/execution/SqlQueryManager.java b/core/trino-main/src/main/java/io/trino/execution/SqlQueryManager.java index 248cd6a6e7b2..0e206a349260 100644 --- a/core/trino-main/src/main/java/io/trino/execution/SqlQueryManager.java +++ b/core/trino-main/src/main/java/io/trino/execution/SqlQueryManager.java @@ -15,6 +15,7 @@ import com.google.common.collect.Ordering; import com.google.common.util.concurrent.ListenableFuture; +import io.airlift.concurrent.SetThreadName; import io.airlift.concurrent.ThreadPoolExecutorMBean; import io.airlift.log.Logger; import io.airlift.units.DataSize; @@ -246,7 +247,9 @@ public void createQuery(QueryExecution queryExecution) queryTracker.expireQuery(queryExecution.getQueryId()); }); - queryExecution.start(); + try (SetThreadName ignored = new SetThreadName("Query-%s", queryExecution.getQueryId())) { + queryExecution.start(); + } } @Override From 676e9c744346a8af3a87818f5263c74cf64a48a9 Mon Sep 17 00:00:00 2001 From: Piotr Findeisen Date: Thu, 23 Mar 2023 10:21:07 +0100 Subject: [PATCH 2/3] Fix thread names in TestEventDrivenTaskSource --- .../io/trino/execution/scheduler/TestEventDrivenTaskSource.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/trino-main/src/test/java/io/trino/execution/scheduler/TestEventDrivenTaskSource.java b/core/trino-main/src/test/java/io/trino/execution/scheduler/TestEventDrivenTaskSource.java index 8d1c4c1f8c62..abb16729ead9 100644 --- a/core/trino-main/src/test/java/io/trino/execution/scheduler/TestEventDrivenTaskSource.java +++ b/core/trino-main/src/test/java/io/trino/execution/scheduler/TestEventDrivenTaskSource.java @@ -103,7 +103,7 @@ public class TestEventDrivenTaskSource @BeforeClass public void setUp() { - executor = listeningDecorator(newScheduledThreadPool(10, daemonThreadsNamed("dispatcher-query-%s"))); + executor = listeningDecorator(newScheduledThreadPool(10, daemonThreadsNamed(getClass().getName()))); } @AfterClass(alwaysRun = true) From e6e99ebf8d94e863fc4a745026e19177091c43ae Mon Sep 17 00:00:00 2001 From: Piotr Findeisen Date: Thu, 23 Mar 2023 10:37:30 +0100 Subject: [PATCH 3/3] Remove unused constant in environment definition --- .../tests/product/launcher/env/environment/EnvMultinode.java | 3 --- 1 file changed, 3 deletions(-) diff --git a/testing/trino-product-tests-launcher/src/main/java/io/trino/tests/product/launcher/env/environment/EnvMultinode.java b/testing/trino-product-tests-launcher/src/main/java/io/trino/tests/product/launcher/env/environment/EnvMultinode.java index 13d9543b145a..33d778b30338 100644 --- a/testing/trino-product-tests-launcher/src/main/java/io/trino/tests/product/launcher/env/environment/EnvMultinode.java +++ b/testing/trino-product-tests-launcher/src/main/java/io/trino/tests/product/launcher/env/environment/EnvMultinode.java @@ -30,7 +30,6 @@ import static io.trino.tests.product.launcher.env.common.Hadoop.CONTAINER_TRINO_HIVE_TIMESTAMP_NANOS; import static io.trino.tests.product.launcher.env.common.Hadoop.CONTAINER_TRINO_HIVE_WITH_EXTERNAL_WRITES_PROPERTIES; import static io.trino.tests.product.launcher.env.common.Hadoop.CONTAINER_TRINO_ICEBERG_PROPERTIES; -import static io.trino.tests.product.launcher.env.common.Standard.CONTAINER_TRINO_ETC; import static io.trino.tests.product.launcher.env.common.Standard.CONTAINER_TRINO_JVM_CONFIG; import static java.util.Objects.requireNonNull; import static org.testcontainers.utility.MountableFile.forHostPath; @@ -39,8 +38,6 @@ public final class EnvMultinode extends EnvironmentProvider { - public static final String CONTAINER_TRINO_HIVE_ACCESS_CONTROL = CONTAINER_TRINO_ETC + "/catalog/hive.properties"; - private final DockerFiles dockerFiles; private final DockerFiles.ResourceProvider configDir;