Skip to content

Commit 23b5ee5

Browse files
raghav-reglobeRaghavclaudemorningman
authored
[fix](arrow-flight) Release a finished Flight query's coordinator instead of holding it until wait_timeout (#67504)
### What problem does this PR solve? Issue Number: close #67503 Related PR: #64799 (kept the coordinator alive across GetFlightInfo → DoGet so the BE can fetch external-table splits; this PR narrows that to the queries that actually need it and bounds how long an abandoned session can hold the rest) Problem Summary: Since #64799 every Arrow Flight SQL query whose results are produced on the BE kept its coordinator alive after `GetFlightInfo`, until the session ran its next query or was closed. The coordinator holds the query's workload-group queue slot and its `active_queries` registration. Most Flight clients open a session per query and never send `CloseSession` (the ADBC/JDBC drivers don't do it on connection close, as the comment in `DorisFlightSqlProducer.closeSession` notes), so each abandoned session pinned one slot for up to `wait_timeout` (8h by default). Observed on a 2-FE cluster with a `max_concurrency=8` workload group: eight finished Flight queries sat in `information_schema.active_queries` as RUNNING for over an hour, and every later query in the group failed with `query queue timeout, timeout: 60000 ms`. Full write-up in #67503. This PR fixes it in two steps: 1. **Only defer the coordinator when the BE still needs it.** The deferral added by #64799 is required only for an external-table scan in batch mode, where the BE lazily fetches splits during `DoGet` from the split source the coordinator holds. Every other query (internal tables, external tables in non-batch mode) now closes its coordinator at the end of `GetFlightInfo` again, releasing the queue slot and the `active_queries` entry right away. That is safe: the BE buffers its results independently of the coordinator, and finalizing the FE side does not cancel BE execution (`QeProcessorImpl.reportExecStatus` accepts reports for an unregistered query, and `Coordinator.close()` only releases the queue token and the split sources). New predicates `ScanNode.hasBatchSplitSource()` / `Coordinator.hasBatchSplitSource()` drive the gate in `StmtExecutor.executeAndSendResult`. 2. **Bound the remaining deferred queries without killing the session.** New mutable FE config `arrow_flight_deferred_query_idle_timeout_second` (default 3600). Once a Flight session has been sleeping for longer than this since its last query started, the connection timeout checker finalizes the session's deferred executors (releasing the slot and the registration) and leaves the session alive; `wait_timeout` still governs the session itself. The bound is floored at the execution timeout the deferred query actually ran with, captured when the executor is deferred (`SET_VAR` hint values are reverted at the end of `execute()`, so the session value cannot be read later). `0` disables the bound. Why not kill the session (the first revision of this PR): a killed Flight session's bearer token stays in the token cache marked as already used, so the client's next call on it fails with `UserSession expire after access` and has to re-handshake. With a 1h bound, every pooled or BI-tool Flight connection that idles for an hour would fail once on its next use. Reaping only the deferred query releases the leaked resources with no client-visible change. ### Release note Arrow Flight SQL: a query no longer holds its workload-group queue slot and `active_queries` entry after `GetFlightInfo` unless it is an external-table scan in batch mode, the only case where the BE still fetches splits from the FE during `DoGet`. For that case a new FE config `arrow_flight_deferred_query_idle_timeout_second` (default 1h) releases the coordinator of an idle, never-closed session without killing the session. ### Check List (For Author) - Test <!-- At least one of them must be included. --> - [x] Regression test (`arrow_flight_sql_p0/test_arrow_flight_query_release`: a finished Flight query on an internal table no longer occupies a `max_concurrency=1` group and is gone from `active_queries`; `external_table_p0/iceberg/test_iceberg_arrow_flight_split_source`: the batch-mode scan stays registered after `DoGet` and is released by the idle reaper while the session survives) - [x] Unit Test (`FlightSqlDeferredQueryIdleTimeoutTest`: the reaper through `checkTimeout`, the exec-timeout floor, `0` disables, nothing deferred, MySQL untouched; `ArrowFlightDeferralGateTest`: the batch-split-source predicates; `StmtExecutorTest.testDeferForArrowFlightFreezesExecTimeoutInEffect`) - [x] Manual test (the first revision was verified on a test cluster with an 8s bound, see the PR history; the current revision is covered by the regression tests above) - [ ] No need to test or manual test. Explain why: - [ ] This is a refactor/code format and no logic has been changed. - [ ] Previous test can cover this change. - [ ] No code files have been changed. - [ ] Other reason <!-- Add your reason? --> - Behavior changed: - [ ] No. - [x] Yes. (1) A Flight query that is not an external-table batch-mode scan releases its coordinator, queue slot and `active_queries` entry at the end of `GetFlightInfo`, as it did before #64799. (2) The deferred coordinator of a batch-mode scan on an idle session is released after 1h by default instead of at `wait_timeout`; set `arrow_flight_deferred_query_idle_timeout_second=0` for the previous behavior. Sessions are never killed by this change. - Does this need documentation? - [ ] No. - [x] Yes. New FE config `arrow_flight_deferred_query_idle_timeout_second` — doris-website PR to follow once this is reviewed. ### Check List (For Reviewer who merge this PR) - [ ] Confirm the release note - [ ] Confirm test cases - [ ] Confirm document - [ ] Add branch pick label <!-- #64799 is in 4.0.8 / 4.1.4 --> --------- Signed-off-by: Raghvendra Singh <[email protected]> Co-authored-by: Raghav <[email protected]> Co-authored-by: Claude Fable 5 <[email protected]> Co-authored-by: morningman <[email protected]>
1 parent 287a334 commit 23b5ee5

11 files changed

Lines changed: 544 additions & 23 deletions

File tree

‎fe/fe-common/src/main/java/org/apache/doris/common/Config.java‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2644,6 +2644,17 @@ public class Config extends ConfigBase {
26442644
@ConfField(description = "Maximum number of connections for the Arrow Flight Server per FE.")
26452645
public static int arrow_flight_max_connections = 4096;
26462646

2647+
@ConfField(mutable = true, description = "Arrow Flight SQL only. A query that scans an external table in "
2648+
+ "batch mode keeps its FE coordinator alive after GetFlightInfo, so the BE can keep fetching splits "
2649+
+ "while the client pulls the results (DoGet); that coordinator is normally released when the "
2650+
+ "session runs its next query or is closed. Most Flight clients never close a session, so the "
2651+
+ "coordinator, and with it the query's workload group queue slot and its active_queries entry, "
2652+
+ "would otherwise stay held until wait_timeout. If the session stays idle for longer than this "
2653+
+ "many seconds after the query started, the coordinator is released anyway. The bound is never "
2654+
+ "shorter than the query's own execution timeout, and the session itself is not killed "
2655+
+ "(wait_timeout still governs that). 0 disables the bound.")
2656+
public static int arrow_flight_deferred_query_idle_timeout_second = 3600;
2657+
26472658
@ConfField(mutable = true, masterOnly = true, description = "In auto bucketing, the number of buckets is "
26482659
+ "estimated based on the partition size. For storage "
26492660
+ "and computing integration, a partition size of 5GB " + "is estimated as one bucket, but for cloud, a "

‎fe/fe-core/src/main/java/org/apache/doris/planner/ScanNode.java‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,17 @@ public TupleDescriptor getTupleDesc() {
134134
return desc;
135135
}
136136

137+
/**
138+
* Whether this scan hands out its splits lazily through a batch {@link SplitSource} that the
139+
* BE fetches from the FE while it is scanning (external-table batch mode, see
140+
* {@link SplitGenerator#isBatchMode()}). Such a scan needs its coordinator alive until the BE
141+
* has finished scanning, even after the FE is done dispatching the query: closing the
142+
* coordinator releases the split source ({@link #stop()}) and the BE's next split fetch fails.
143+
*/
144+
public boolean hasBatchSplitSource() {
145+
return splitAssignment != null;
146+
}
147+
137148
protected abstract void createScanRangeLocations() throws UserException;
138149

139150
/**

‎fe/fe-core/src/main/java/org/apache/doris/qe/ConnectContext.java‎

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1006,7 +1006,9 @@ public void clear() {
10061006
// held by the coordinator's scan nodes), so closing the coordinator at the end of
10071007
// GetFlightInfo would release the SplitSource too early and make the BE's fetchSplitBatch fail
10081008
// with "Split source X is released". These executors are finalized when the next query starts
1009-
// on this connection, or when the connection is torn down. See #62259.
1009+
// on this connection, when the connection is torn down, or by the idle reaper in checkTimeout
1010+
// once the connection has been sleeping for arrow_flight_deferred_query_idle_timeout_second.
1011+
// See #62259 and #67503.
10101012
private final List<StmtExecutor> flightSqlDeferredExecutors = new ArrayList<>();
10111013

10121014
public void addFlightSqlDeferredExecutor(StmtExecutor executor) {
@@ -1033,6 +1035,45 @@ public void closeFlightSqlDeferredExecutors() {
10331035
}
10341036
}
10351037

1038+
/**
1039+
* How long, in seconds, a sleeping connection may keep its deferred Arrow Flight executors
1040+
* before the timeout checker finalizes them without killing the connection
1041+
* (Config.arrow_flight_deferred_query_idle_timeout_second). A Flight client that opens a
1042+
* session per query and never closes it would otherwise pin each deferred query's query queue
1043+
* slot and query registration until wait_timeout (8h by default). The bound is never shorter
1044+
* than the execution timeout the deferred query was run with: the client may still be pulling
1045+
* that query's results from the BE, which still needs the batch split source the coordinator
1046+
* holds. Returns -1 when the bound is disabled or nothing is deferred.
1047+
*/
1048+
public long getFlightSqlDeferredExecutorsIdleTimeoutS() {
1049+
int configTimeoutS = Config.arrow_flight_deferred_query_idle_timeout_second;
1050+
if (configTimeoutS <= 0) {
1051+
return -1;
1052+
}
1053+
long execTimeoutS = -1;
1054+
synchronized (flightSqlDeferredExecutors) {
1055+
if (flightSqlDeferredExecutors.isEmpty()) {
1056+
return -1;
1057+
}
1058+
for (StmtExecutor deferredExecutor : flightSqlDeferredExecutors) {
1059+
execTimeoutS = Math.max(execTimeoutS, deferredExecutor.getDeferredExecTimeoutS());
1060+
}
1061+
}
1062+
return Math.max(configTimeoutS, execTimeoutS);
1063+
}
1064+
1065+
// Called by the timeout checker for a sleeping connection that is not past wait_timeout yet.
1066+
private void reapIdleFlightSqlDeferredExecutors(long idleMs) {
1067+
long timeoutS = getFlightSqlDeferredExecutorsIdleTimeoutS();
1068+
if (timeoutS < 0 || idleMs <= timeoutS * 1000L) {
1069+
return;
1070+
}
1071+
LOG.warn("release deferred arrow flight query of idle connection, connectionId: {}, remote: {}, "
1072+
+ "idle: {}ms, idle timeout: {}s",
1073+
connectionId, getRemoteHostPortString(), idleMs, timeoutS);
1074+
closeFlightSqlDeferredExecutors();
1075+
}
1076+
10361077
/**
10371078
* This method is idempotent.
10381079
*/
@@ -1305,6 +1346,8 @@ public void checkTimeout(long now) {
13051346
// Need kill this connection.
13061347
killFlag = true;
13071348
killConnection = true;
1349+
} else {
1350+
reapIdleFlightSqlDeferredExecutors(delta);
13081351
}
13091352
} else {
13101353
String timeoutTag = "query";

‎fe/fe-core/src/main/java/org/apache/doris/qe/Coordinator.java‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -810,6 +810,25 @@ public void exec() throws Exception {
810810
execInternal();
811811
}
812812

813+
/**
814+
* Whether the BE keeps calling back into this coordinator after {@link #exec()} returned: an
815+
* external-table scan in batch mode fetches its splits lazily from the split source that its
816+
* scan node holds, so the coordinator must not be closed until the BE has finished scanning.
817+
* Arrow Flight SQL uses this to decide whether a query's coordinator has to outlive
818+
* GetFlightInfo, the client pulling the results from the BE later in DoGet. See #62259.
819+
*/
820+
public boolean hasBatchSplitSource() {
821+
if (scanNodes == null) {
822+
return false;
823+
}
824+
for (ScanNode scanNode : scanNodes) {
825+
if (scanNode.hasBatchSplitSource()) {
826+
return true;
827+
}
828+
}
829+
return false;
830+
}
831+
813832
@Override
814833
public void close() {
815834
// NOTE: all close method should be no exception

‎fe/fe-core/src/main/java/org/apache/doris/qe/StmtExecutor.java‎

Lines changed: 34 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,10 @@ public class StmtExecutor {
208208
// is finalized later by ConnectContext (see #62259), so the eager close in executeAndSendResult
209209
// is skipped.
210210
private volatile boolean deferredForArrowFlight = false;
211+
// The execution timeout in effect when the coordinator was deferred. Captured at that moment
212+
// because per-statement SET_VAR values are reverted at the end of execute(), so reading
213+
// ConnectContext.getExecTimeoutS() later would report the session value instead.
214+
private volatile int deferredExecTimeoutS = -1;
211215
private MasterOpExecutor masterOpExecutor = null;
212216
// Optional forward target for cancellations issued on this executor: statements that
213217
// spawn a nested internal executor with its own query id (e.g. IVM dry-run delta
@@ -1084,6 +1088,21 @@ public boolean isDeferredForArrowFlight() {
10841088
return deferredForArrowFlight;
10851089
}
10861090

1091+
// Execution timeout (seconds) the deferred query was run with; -1 when the query is not deferred.
1092+
public int getDeferredExecTimeoutS() {
1093+
return deferredExecTimeoutS;
1094+
}
1095+
1096+
// Keep this query's coordinator alive past GetFlightInfo (see the gate in executeAndSendResult)
1097+
// and hand it to the ConnectContext, which finalizes it later. Records the execution timeout in
1098+
// effect right now: it floors the idle reaper's bound and must be the value the query actually
1099+
// ran with, not the session value left behind after SET_VAR hints are reverted.
1100+
void deferForArrowFlight() {
1101+
deferredForArrowFlight = true;
1102+
deferredExecTimeoutS = context.getExecTimeoutS();
1103+
context.addFlightSqlDeferredExecutor(this);
1104+
}
1105+
10871106
// Finalize an Arrow Flight query whose coordinator was kept alive across the
10881107
// GetFlightInfo -> DoGet phases: close the coordinator (releasing external-table batch
10891108
// SplitSources and the query queue slot) and then unregister the query. See #62259.
@@ -1563,23 +1582,21 @@ public void executeAndSendResult(boolean isOutfileQuery, boolean isSendFields,
15631582
if (context.getConnectType().equals(ConnectType.ARROW_FLIGHT_SQL)) {
15641583
Preconditions.checkState(!context.isReturnResultFromLocal());
15651584
profile.getSummaryProfile().setTempStartTime();
1566-
// Defer closing the coordinator to ConnectContext (closed on the next query or
1567-
// connection teardown) instead of in the finally block below. This gate covers
1568-
// every Arrow Flight query whose results are produced on the BE (coordBase ==
1569-
// coord) -- internal-table and external, batch or not. It is REQUIRED only for an
1570-
// external-table scan in batch mode, where the BE lazily fetches splits from the FE
1571-
// during the later DoGet phase, so closing the coordinator here would release its
1572-
// batch SplitSource too early and break DoGet. Other remote-result queries do not
1573-
// need deferral (the BE buffers their result independently) but are captured by the
1574-
// same gate; the trade-off is their coordinator, query queue slot and query
1575-
// registration stay held until the next query / teardown instead of being released
1576-
// at the end of GetFlightInfo. A short-circuit point query is the one case with a
1577-
// different coordBase, and it can no longer reach here: it has no Arrow result on
1578-
// either side, so LogicalResultSinkToShortCircuitPointQuery keeps Arrow Flight SQL
1579-
// on the normal execution path. See #62259 and #67368.
1580-
if (coordBase == coord) {
1581-
deferredForArrowFlight = true;
1582-
context.addFlightSqlDeferredExecutor(this);
1585+
// The client pulls the results from the BE later (DoGet). Only an external-table
1586+
// scan in batch mode still needs the coordinator after this point: the BE fetches
1587+
// its splits lazily from the split source the coordinator holds, so closing the
1588+
// coordinator here would release that source too early and break DoGet (#62259).
1589+
// Such a coordinator is closed later by ConnectContext: on the session's next
1590+
// query, on teardown, or by the idle reaper in checkTimeout. The trade-off is that
1591+
// its query queue slot and query registration stay held until then. Every other
1592+
// query closes its coordinator in the finally block below and releases both right
1593+
// away, the BE buffering its results independently of the coordinator (#67503).
1594+
// A short-circuit point query is the one case with a different coordBase, and it
1595+
// can no longer reach here: it has no Arrow result on either side, so
1596+
// LogicalResultSinkToShortCircuitPointQuery keeps Arrow Flight SQL on the normal
1597+
// execution path (#67368).
1598+
if (coordBase == coord && coord.hasBatchSplitSource()) {
1599+
deferForArrowFlight();
15831600
}
15841601
return;
15851602
}

‎fe/fe-core/src/main/java/org/apache/doris/service/arrowflight/FlightSqlConnectProcessor.java‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -196,11 +196,12 @@ public void fetchArrowFlightSchema(int timeoutMs) {
196196
@Override
197197
public void close() throws Exception {
198198
ctx.setCommand(MysqlCommand.COM_SLEEP);
199-
// Executors whose results are pulled from the BE keep their coordinator alive past
200-
// GetFlightInfo (registered as deferred executors on the ConnectContext) so the BE can
201-
// still fetch external-table splits during DoGet. Do NOT finalize those here; they are
202-
// finalized when the next query starts or the connection is torn down. Executors that are
203-
// not deferred (local results, or a query that already failed) are finalized now. See #62259.
199+
// An external-table scan in batch mode keeps its coordinator alive past GetFlightInfo
200+
// (registered as a deferred executor on the ConnectContext) so the BE can still fetch its
201+
// splits during DoGet. Do NOT finalize those here; they are finalized when the next query
202+
// starts, when the connection is torn down, or by the idle reaper in
203+
// ConnectContext.checkTimeout. Every other executor (local results, results the BE buffers
204+
// on its own, or a query that already failed) is finalized now. See #62259 and #67503.
204205
for (StmtExecutor asynExecutor : returnResultFromRemoteExecutor) {
205206
if (!asynExecutor.isDeferredForArrowFlight()) {
206207
asynExecutor.finalizeQuery();
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
// Licensed to the Apache Software Foundation (ASF) under one
2+
// or more contributor license agreements. See the NOTICE file
3+
// distributed with this work for additional information
4+
// regarding copyright ownership. The ASF licenses this file
5+
// to you under the Apache License, Version 2.0 (the
6+
// "License"); you may not use this file except in compliance
7+
// with the License. You may obtain a copy of the License at
8+
//
9+
// http://www.apache.org/licenses/LICENSE-2.0
10+
//
11+
// Unless required by applicable law or agreed to in writing,
12+
// software distributed under the License is distributed on an
13+
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
// KIND, either express or implied. See the License for the
15+
// specific language governing permissions and limitations
16+
// under the License.
17+
18+
package org.apache.doris.qe;
19+
20+
import org.apache.doris.analysis.DescriptorTable;
21+
import org.apache.doris.datasource.split.SplitAssignment;
22+
import org.apache.doris.planner.PlanFragment;
23+
import org.apache.doris.planner.ScanNode;
24+
import org.apache.doris.thrift.TUniqueId;
25+
26+
import com.google.common.collect.Lists;
27+
import org.junit.jupiter.api.Assertions;
28+
import org.junit.jupiter.api.Test;
29+
import org.mockito.Mockito;
30+
31+
import java.lang.reflect.Field;
32+
import java.util.List;
33+
34+
/**
35+
* The predicate behind the Arrow Flight deferral gate in StmtExecutor.executeAndSendResult (#67503):
36+
* a coordinator has to outlive GetFlightInfo only when one of its scans still hands out splits to
37+
* the BE lazily, i.e. an external-table scan in batch mode holding a batch split source (#62259).
38+
*/
39+
public class ArrowFlightDeferralGateTest {
40+
41+
private static ScanNode scanNode(boolean batchSplitSource) throws Exception {
42+
ScanNode node = Mockito.mock(ScanNode.class, Mockito.CALLS_REAL_METHODS);
43+
if (batchSplitSource) {
44+
// FileQueryScanNode.createScanRangeLocations sets this only in batch mode.
45+
Field field = ScanNode.class.getDeclaredField("splitAssignment");
46+
field.setAccessible(true);
47+
field.set(node, Mockito.mock(SplitAssignment.class));
48+
}
49+
return node;
50+
}
51+
52+
private static Coordinator coordinator(List<ScanNode> scanNodes) {
53+
return new Coordinator(1L, new TUniqueId(1L, 2L), new DescriptorTable(), Lists.<PlanFragment>newArrayList(),
54+
scanNodes, "UTC", false, false);
55+
}
56+
57+
@Test
58+
public void testScanNodeHasBatchSplitSourceOnlyWhenSplitsAreHandedOutLazily() throws Exception {
59+
Assertions.assertFalse(scanNode(false).hasBatchSplitSource());
60+
Assertions.assertTrue(scanNode(true).hasBatchSplitSource());
61+
}
62+
63+
@Test
64+
public void testCoordinatorHasBatchSplitSourceIfAnyScanDoes() throws Exception {
65+
Assertions.assertFalse(coordinator(Lists.newArrayList()).hasBatchSplitSource());
66+
Assertions.assertFalse(coordinator(Lists.newArrayList(scanNode(false), scanNode(false))).hasBatchSplitSource());
67+
Assertions.assertTrue(coordinator(Lists.newArrayList(scanNode(false), scanNode(true))).hasBatchSplitSource());
68+
}
69+
}

‎fe/fe-core/src/test/java/org/apache/doris/qe/StmtExecutorTest.java‎

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,39 @@ public void testShowNull() throws Exception {
7878
Assertions.assertEquals(QueryState.MysqlStateType.OK, connectContext.getState().getStateType());
7979
}
8080

81+
// The deferral gate (#67503): a coordinator is kept alive past GetFlightInfo only when the BE
82+
// still fetches splits from it (Coordinator.hasBatchSplitSource), and the execution timeout it
83+
// ran with is frozen at that moment. SET_VAR hint values are reverted when execute() ends, so
84+
// the idle reaper must not read the session value later.
85+
@Test
86+
public void testDeferForArrowFlightFreezesExecTimeoutInEffect() throws Exception {
87+
int savedQueryTimeout = connectContext.getSessionVariable().getQueryTimeoutS();
88+
int savedIdleTimeout = Config.arrow_flight_deferred_query_idle_timeout_second;
89+
connectContext.setQueryId(new TUniqueId(0x67503L, 0x1L));
90+
try {
91+
Config.arrow_flight_deferred_query_idle_timeout_second = 1;
92+
connectContext.getSessionVariable().setQueryTimeoutS(1234);
93+
StmtExecutor stmtExecutor = new StmtExecutor(connectContext, "");
94+
Assertions.assertFalse(stmtExecutor.isDeferredForArrowFlight());
95+
Assertions.assertEquals(-1, stmtExecutor.getDeferredExecTimeoutS());
96+
97+
stmtExecutor.deferForArrowFlight();
98+
99+
Assertions.assertTrue(stmtExecutor.isDeferredForArrowFlight());
100+
Assertions.assertEquals(1234, stmtExecutor.getDeferredExecTimeoutS());
101+
// the reaper's bound is floored at the frozen value ...
102+
Assertions.assertEquals(1234L, connectContext.getFlightSqlDeferredExecutorsIdleTimeoutS());
103+
// ... even after the session value moved on, as it does when a SET_VAR hint is reverted
104+
connectContext.getSessionVariable().setQueryTimeoutS(5);
105+
Assertions.assertEquals(1234, stmtExecutor.getDeferredExecTimeoutS());
106+
Assertions.assertEquals(1234L, connectContext.getFlightSqlDeferredExecutorsIdleTimeoutS());
107+
} finally {
108+
connectContext.closeFlightSqlDeferredExecutors();
109+
connectContext.getSessionVariable().setQueryTimeoutS(savedQueryTimeout);
110+
Config.arrow_flight_deferred_query_idle_timeout_second = savedIdleTimeout;
111+
}
112+
}
113+
81114
// Arrow Flight SQL keeps a query's coordinator alive across GetFlightInfo -> DoGet (see #62259);
82115
// it is released later by finalizeArrowFlightQuery(), which closes the coordinator and then
83116
// unregisters the query. The close and the unregister must be independent: if coord.close()

0 commit comments

Comments
 (0)