github-actions[bot] commented on code in PR #68631:
URL: https://github.com/apache/doris/pull/68631#discussion_r4140024678


##########
fe/fe-core/src/main/java/org/apache/doris/service/arrowflight/DorisFlightSqlProducer.java:
##########
@@ -318,18 +330,91 @@ public FlightInfo getFlightInfoStatement(final 
CommandStatementQuery request, fi
     @Override
     public FlightInfo getFlightInfoPreparedStatement(final 
CommandPreparedStatementQuery command,
             final CallContext context, final FlightDescriptor descriptor) {
-        String[] handleParts = 
command.getPreparedStatementHandle().toStringUtf8().split(":");
-        String executedPeerIdentity = handleParts[0];
-        String preparedStatementId = handleParts[1];
-        ConnectContext connectContext = 
flightSessionsManager.getConnectContext(executedPeerIdentity);
-        return executeQueryStatement(executedPeerIdentity, connectContext,
-                connectContext.getPreparedQuery(preparedStatementId), 
descriptor);
+        ConnectContext connection = 
flightSessionsManager.getConnectContext(context.peerIdentity());
+        synchronized (connection) {
+            Pair<String, Schema> prepared = preparedQuery(connection, context, 
command);
+            FlightInfo info = executeQueryStatement(context.peerIdentity(), 
connection, prepared.getLeft(), descriptor);

Review Comment:
   [P1] Retain the executor for prepared BE schema validation. 
`executeQueryStatementLocked` returns from a try-with-resources 
`FlightSqlConnectProcessor`, whose `close()` calls `ctx.clear()` and sets 
`executor` to null. This getter therefore always takes the strict 
`Schema.equals` fallback for BE results. A normal prepared `SELECT 1` 
advertises FE label `1` but can return BE label `Int64_0`, so GetFlightInfo 
expires a valid handle despite the compatibility matcher above; the mocked 
processor tests never run the real `close()`. The same null executor makes 
`cancelQuery` a no-op on a genuine drift. Retain the final executor or semantic 
labels through the comparison and cancel that executor before deferred cleanup.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to