yuzelin commented on code in PR #21133:
URL: https://github.com/apache/flink/pull/21133#discussion_r1022368927


##########
flink-table/flink-sql-gateway/src/main/java/org/apache/flink/table/gateway/service/SqlGatewayServiceImpl.java:
##########
@@ -79,6 +82,32 @@ public void closeSession(SessionHandle sessionHandle) throws 
SqlGatewayException
         }
     }
 
+    @Override
+    public ResultSet configureSession(
+            SessionHandle sessionHandle, String statement, long 
executionTimeoutMs)
+            throws SqlGatewayException {
+        try {
+            if (executionTimeoutMs > 0) {
+                // TODO: support the feature in FLINK-27838
+                throw new UnsupportedOperationException(
+                        "SqlGatewayService doesn't support timeout mechanism 
now.");
+            }
+            OperationHandle operationHandle =
+                    getSession(sessionHandle)
+                            .getOperationManager()
+                            .submitOperation(
+                                    handle ->
+                                            getSession(sessionHandle)
+                                                    .createExecutor()
+                                                    .configureSession(handle, 
statement));
+            return fetchConfigureSessionResult(sessionHandle, operationHandle);

Review Comment:
   For the Operation (not the flink table operation; it is the gateway service 
operation) submitted to `OperationManager`, it has to get lock (see 
[operationLock](https://github.com/apache/flink/blob/3c9a394c608125827d224180c44128718972a82c/flink-table/flink-sql-gateway/src/main/java/org/apache/flink/table/gateway/service/operation/OperationManager.java#L66)
 before running. And we make sure that the configure session returns after the 
execution result is ready, so concurrency problem won't happen here (for 
example, if two clients holds the same `SessionHandle` somehow and submit two 
conflict configuring statement, one should succeed and then another should 
fail).
   



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

Reply via email to