Gabriel39 commented on code in PR #68631:
URL: https://github.com/apache/doris/pull/68631#discussion_r4140057215


##########
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:
   Fixed in f311672709f. This lifecycle issue was valid: the processor closes 
before the caller validates the execution schema, so reading 
ConnectContext.getExecutor() afterward loses both the semantic labels and the 
cancellation target.
   
   Execution now returns FlightInfo together with the final StmtExecutor 
captured before close(). Prepared validation uses that retained executor and 
cancels it directly before deferred cleanup on schema drift.
   
   The producer tests now delegate close() to a real FlightSqlConnectProcessor 
using the same context. They verify that the context executor is cleared, 
compatible BE schemas preserve deferred resources, and incompatible schemas 
cancel the retained executor before finalization. The updated tests reproduced 
three failures before the fix. All 60 focused tests, FE Checkstyle, and the 
existing schema-only regression through the local Flight RPC harness pass. Full 
BE/external regression remains for CI.



-- 
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