fsk119 commented on code in PR #20149:
URL: https://github.com/apache/flink/pull/20149#discussion_r921088655
##########
flink-table/flink-sql-gateway/src/test/java/org/apache/flink/table/gateway/service/SqlGatewayServiceITCase.java:
##########
@@ -365,12 +367,124 @@ public void
testSubmitOperationAndCloseOperationManagerInParallel() throws Excep
assertEquals(0, manager.getOperationCount());
}
+ @Test
+ public void testSubmitOperationAndCloseOperationManagerInParallel2()
throws Exception {
+ int count = 3;
+ CountDownLatch startRunning = new CountDownLatch(1);
+ CountDownLatch terminateRunning = new CountDownLatch(1);
+ SessionHandle sessionHandle =
service.openSession(defaultSessionEnvironment);
+ for (int i = 0; i < count; i++) {
+ threadFactory
+ .newThread(
+ () ->
+ service.submitOperation(
+ sessionHandle,
+ OperationType.UNKNOWN,
+ () -> {
+ startRunning.countDown();
+ terminateRunning.await();
+ return null;
+ }))
+ .start();
+ }
+ startRunning.await();
+ // close session should not be blocked
+ service.getSession(sessionHandle).getOperationManager().close();
+ terminateRunning.countDown();
Review Comment:
It just clean up all used resources.
--
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]