You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 674e491
Browse filesBrowse the repository at this point in the historyBrowse files
[feature](arrow-flight) Close the session to what is deferred after teardown, count a backend result as one, fence the empty schema
Three gaps left by the previous commits, each closed where its rule is
stated.
- Teardown (CloseSession, the bearer token's expiry, KILL, the timeout
checker: all through FlightSqlConnectPoolMgr.unregisterConnection) does
not wait for the command that may be running on the session. Such a
command could still defer its query after teardown had taken everything
the list held, and nothing would ever take that executor: the session
runs no next request, and the timeout checker no longer sees the
context. The coordinator, its batch split source, its queue slot and
its query registration stayed until the frontend restarted. Teardown now
tombstones the adapter (FlightProtocolAdapter.tearDown, set under the
list's monitor): an executor deferred after it is finalized on the spot
by the command that deferred it, and a command that gets its turn on
the lock after teardown fails with UNAUTHENTICATED, as any later call
of the session would, instead of running on a context nothing tracks.
The exactly-once rule in the class comment holds across teardown now.
- finishStatement enforced "only the last statement of a request may
produce a result" for results cached on this frontend alone; a result
left on the backends was not counted, so SELECT; SELECT delivered both
queries' endpoints in one FlightInfo (read as the partitions of one
result when the schemas agree) and SELECT; SET dropped the query's
endpoints for the SET's status. A query that is not the last statement
is now refused with the same error, before the next statement runs --
which also finalizes it while the session's query id is still its own.
A statement that failed produced no result and keeps its own error.
- The empty schema value, which puts the session back into no database
without running a statement, went around the one gate every statement
passes first: a transaction takes only its own statements, and USE,
SWITCH and SET are refused while one is open. Leaving the database is
refused the same way now (ERROR, as USE answers there), with nothing
mutated.
Tests: FlightProtocolAdapterTest (a torn-down session, through the real
KILL path with the command still holding the lock: what it defers
afterwards is finalized once by the command, and the next command is
refused; a backend result before the last statement is refused, as the
last it is the request's, a failed query keeps its error),
FlightSessionOptionsTest.testNoOptionChangesTheSessionInsideATransaction
(real BEGIN / ROLLBACK, the empty value and the empty string),
FlightSqlConnectPoolMgrTest (teardown reaches tearDown), and the
lifecycle regression suite (SELECT; SELECT and SELECT; SET refused, the
SET not run).
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01Ja986K4PEm2LD8u44L9jd2
0 commit comments