Skip to content

Commit

Permalink
Log query state when memory pool leaks detected in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
losipiuk committed Mar 16, 2022
1 parent ad27b12 commit 43f702f
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import com.google.errorprone.annotations.CanIgnoreReturnValue;
import io.airlift.units.Duration;
import io.trino.Session;
import io.trino.execution.QueryState;
import io.trino.execution.QueryStats;
import io.trino.execution.warnings.WarningCollector;
import io.trino.memory.LocalMemoryManager;
Expand Down Expand Up @@ -164,11 +165,13 @@ private String describeMemoryPool(TestingTrinoServer coordinator, TestingTrinoSe
queriesWithMemory.forEach(queryInfo -> {
QueryId queryId = queryInfo.getQueryId();
String querySql = queryInfo.getQuery();
QueryState queryState = queryInfo.getState();
Long memoryReservation = queryReservations.getOrDefault(queryId, 0L);
Map<String, Long> taggedMemoryReservation = queryTaggedReservations.getOrDefault(queryId, ImmutableMap.of());

result.append(" " + queryId + ":\n");
result.append(" SQL: " + querySql + "\n");
result.append(" state: " + queryState + "\n");
result.append(" memoryReservation: " + memoryReservation + "\n");
result.append(" taggedMemoryReservaton: " + taggedMemoryReservation + "\n");
});
Expand Down

0 comments on commit 43f702f

Please sign in to comment.