From e1f1c0e8968814cf58b70cf90eeade313db816c5 Mon Sep 17 00:00:00 2001 From: Devin Smith Date: Wed, 11 Dec 2024 14:43:54 -0800 Subject: [PATCH] Open ExecutionContext --- .../io/deephaven/server/flightsql/FlightSqlResolver.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/extensions/flight-sql/src/main/java/io/deephaven/server/flightsql/FlightSqlResolver.java b/extensions/flight-sql/src/main/java/io/deephaven/server/flightsql/FlightSqlResolver.java index e34cb2cfdaa..6fb7b4cdf76 100644 --- a/extensions/flight-sql/src/main/java/io/deephaven/server/flightsql/FlightSqlResolver.java +++ b/extensions/flight-sql/src/main/java/io/deephaven/server/flightsql/FlightSqlResolver.java @@ -641,7 +641,8 @@ interface TicketHandlerReleasable extends TicketHandler { } private Table executeSqlQuery(String sql) { - final QueryScope queryScope = ExecutionContext.getContext().getQueryScope(); + final ExecutionContext executionContext = ExecutionContext.getContext(); + final QueryScope queryScope = executionContext.getQueryScope(); // We aren't managing the liveness of Tables that come verbatim (authorization un-transformed) from the query // scope (we are ensuring that any transformed, or operation created, tables don't escape to a higher-layer's // liveness scope). In the case where they either are already not live, or become not live by the time the @@ -685,7 +686,11 @@ private Table executeSqlQuery(String sql) { // io.deephaven.auth.ServiceAuthWiring checks. // TODO(deephaven-core#6307): Declarative server-side table execution logic that preserves authorization // logic - try (final SafeCloseable ignored1 = updateGraph == null ? null : updateGraph.sharedLock().lockCloseable()) { + try ( + final SafeCloseable ignored0 = + updateGraph == null ? null : executionContext.withUpdateGraph(updateGraph).open(); + final SafeCloseable ignored1 = + updateGraph == null ? null : updateGraph.sharedLock().lockCloseable()) { final Table table = tableSpec.logic().create(tableCreator); if (table.isRefreshing()) { table.retainReference();