pnowojski commented on code in PR #22900:
URL: https://github.com/apache/flink/pull/22900#discussion_r1246351087


##########
flink-runtime/src/test/java/org/apache/flink/runtime/source/coordinator/SourceCoordinatorTestBase.java:
##########
@@ -215,7 +211,7 @@ Source<Integer, MockSourceSplit, Set<MockSourceSplit>> 
createMockSource() {
 
     protected SourceCoordinatorContext<MockSourceSplit> 
getNewSourceCoordinatorContext() {
         return new SourceCoordinatorContext<>(
-                coordinatorExecutor,
+                Executors.newScheduledThreadPool(1, coordinatorThreadFactory),
                 Executors.newScheduledThreadPool(
                         1,
                         new ExecutorThreadFactory(

Review Comment:
   Can you check that each created coordinator is actually properly closed? I 
think there are places:
   
org.apache.flink.runtime.source.coordinator.SourceCoordinatorTest#testSerdeBackwardCompatibility
   
org.apache.flink.runtime.source.coordinator.SourceCoordinatorConcurrentAttemptsTest#testCoordinatorThrowExceptionIfWatermarkAlignmentIsEnabled
   
   Where this is not true, and your change would cause a thread leak? Maybe 
instead of fixing each place individually, we can drop 
`sourceCoordinator.close()` from `@AfterEach` method above, and just create a 
`CloseableRegistry`, where this method `getNewSourceCoordinatorContext` would 
register every newly created registry and we could clean reigstry in 
`@AfterEach`?
   
   



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