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


##########
fe/fe-core/src/main/java/org/apache/doris/arrowflight/DorisFlightSqlProducer.java:
##########
@@ -368,19 +392,126 @@ 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);
+        String preparedStatementId = preparedStatementId(context, 
command.getPreparedStatementHandle());
+        ConnectContext connectContext = 
flightSessionsManager.getConnectContext(context.peerIdentity());
         return 
FlightProtocolAdapter.of(connectContext).callCommand(connectContext,
-                () -> executeQueryStatement(executedPeerIdentity, 
connectContext,
-                        connectContext.getPreparedQuery(preparedStatementId), 
descriptor));
+                () -> executePreparedStatement(context.peerIdentity(), 
connectContext, preparedStatementId,

Review Comment:
   [P2] Clear the previous request before a prepared schema precheck can fail
   
   `getFlightInfoPreparedStatement` runs `checkPreparedSchema()` before 
`executeQueryStatement()` reaches `FlightProtocolAdapter.beginRequest()`. If 
the schema is stale (for example after a `sql_mode` change or DDL), 
`checkPreparedSchema` removes the handle and throws `NOT_FOUND`, so the prior 
request's deferred coordinator, endpoints, and cached frontend result are never 
reset. A client that executes a remote query, then makes this failed prepared 
request, leaves that coordinator pinned until the idle timeout instead of 
following the normal query cleanup path. Start the request cleanup before this 
precheck, or explicitly perform the same cleanup on every precheck failure.



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