Search before asking
Version
master (current head 219c619) and the 3.x/4.x lineage since #64799.
What's Wrong?
Since #64799 the FE keeps a BE-served Flight SQL query's coordinator alive after GetFlightInfo so the BE can still fetch external-table splits during DoGet. The coordinator is finalized only when the session runs its next query or is closed (CloseSession, idle kill, token expiry). While it lives it holds the query's workload-group queue slot and its information_schema.active_queries registration.
A Flight session idles under the same wait_timeout as a MySQL connection (28800s by default). Most Flight clients open a session per query and never send CloseSession (the ADBC and JDBC drivers do not send it on connection close, as the comment in DorisFlightSqlProducer.closeSession notes). So each abandoned session pins one queue slot for up to eight hours.
With max_concurrency=8 on the group, eight finished queries were enough: they stayed RUNNING in active_queries for over an hour and every later query in the group failed with query queue timeout, timeout: 60000 ms. SELECT 1-class queries kept working because they never enter the queue, which makes the lockout look intermittent.
What You Expected?
An abandoned Flight session should not hold a queue slot for hours. Either the slot is released once the result has been fetched, or Flight sessions get an idle bound much shorter than wait_timeout — without ever cutting a query short of its own query_timeout.
How to Reproduce?
CREATE WORKLOAD GROUP wg_t PROPERTIES ('max_concurrency'='2','max_queue_size'='5','queue_timeout'='10000'), grant it to a user and set it as their default workload group.- From a Flight SQL client, twice: handshake →
GetFlightInfo on a scanning query (any table) → DoGet the result → do NOT close the session (or exit the process without CloseSession). - On the FE:
SELECT * FROM information_schema.active_queries — both finished queries are still RUNNING; SHOW PROCESSLIST shows two Sleep sessions with Host = 0.0.0.0:0. - Run a third scanning query in that group from any protocol: it queues and fails after 10s with
query queue timeout. KILL CONNECTION <id> on either Flight session: the slot is released immediately.
Anything Else?
The MySQL protocol path releases the slot when the result is sent (finalizeCommand), so only Flight is affected. On the Doris side the natural fix is a Flight-specific idle bound — a new FE config applied by the existing connection timeout checker, floored at the query's exec timeout so a long DoGet drain is never killed early. Clients should still send CloseSession.
Are you willing to submit PR?
Code of Conduct
Search before asking
Version
master (current head 219c619) and the 3.x/4.x lineage since #64799.
What's Wrong?
Since #64799 the FE keeps a BE-served Flight SQL query's coordinator alive after
GetFlightInfoso the BE can still fetch external-table splits duringDoGet. The coordinator is finalized only when the session runs its next query or is closed (CloseSession, idle kill, token expiry). While it lives it holds the query's workload-group queue slot and itsinformation_schema.active_queriesregistration.A Flight session idles under the same
wait_timeoutas a MySQL connection (28800s by default). Most Flight clients open a session per query and never sendCloseSession(the ADBC and JDBC drivers do not send it on connection close, as the comment inDorisFlightSqlProducer.closeSessionnotes). So each abandoned session pins one queue slot for up to eight hours.With
max_concurrency=8on the group, eight finished queries were enough: they stayedRUNNINGinactive_queriesfor over an hour and every later query in the group failed withquery queue timeout, timeout: 60000 ms.SELECT 1-class queries kept working because they never enter the queue, which makes the lockout look intermittent.What You Expected?
An abandoned Flight session should not hold a queue slot for hours. Either the slot is released once the result has been fetched, or Flight sessions get an idle bound much shorter than
wait_timeout— without ever cutting a query short of its ownquery_timeout.How to Reproduce?
CREATE WORKLOAD GROUP wg_t PROPERTIES ('max_concurrency'='2','max_queue_size'='5','queue_timeout'='10000'), grant it to a user and set it as their default workload group.GetFlightInfoon a scanning query (any table) →DoGetthe result → do NOT close the session (or exit the process withoutCloseSession).SELECT * FROM information_schema.active_queries— both finished queries are stillRUNNING;SHOW PROCESSLISTshows twoSleepsessions withHost = 0.0.0.0:0.query queue timeout.KILL CONNECTION <id>on either Flight session: the slot is released immediately.Anything Else?
The MySQL protocol path releases the slot when the result is sent (
finalizeCommand), so only Flight is affected. On the Doris side the natural fix is a Flight-specific idle bound — a new FE config applied by the existing connection timeout checker, floored at the query's exec timeout so a longDoGetdrain is never killed early. Clients should still sendCloseSession.Are you willing to submit PR?
Code of Conduct