You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "RocMarshal (via GitHub)" <gi...@apache.org> on 2023/06/26 11:20:38 UTC

[GitHub] [flink] RocMarshal commented on a diff in pull request #22845: [FLINK-32411][connector/common] Fix the bug about SourceCoordinator thread leaks

RocMarshal commented on code in PR #22845:
URL: https://github.com/apache/flink/pull/22845#discussion_r1242033699


##########
flink-runtime/src/main/java/org/apache/flink/runtime/source/coordinator/SourceCoordinator.java:
##########
@@ -270,8 +269,9 @@ public void start() throws Exception {
     @Override
     public void close() throws Exception {
         LOG.info("Closing SourceCoordinator for source {}.", operatorName);
+        closeQuietly(context);
         if (started) {
-            closeAll(asList(context, enumerator), Throwable.class);
+            closeQuietly(enumerator);

Review Comment:
   Could we force constraints on the order of closing `context` and `enumerator` as follows:
   Because `context` was used by  `enumerator`, This is a bit like the close order in the I/O mechanism.
   
   ```
           if (started) {
               closeQuietly(enumerator);
           }
           closeQuietly(context);
   ```
   
   Although not doing so will not result in semantic errors.



-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org