You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@samza.apache.org by GitBox <gi...@apache.org> on 2020/11/10 21:39:19 UTC

[GitHub] [samza] sborya commented on a change in pull request #1437: SAMZA-2598:Kafka clients are not created and closed properly

sborya commented on a change in pull request #1437:
URL: https://github.com/apache/samza/pull/1437#discussion_r520889344



##########
File path: samza-core/src/main/java/org/apache/samza/coordinator/metadatastore/CoordinatorStreamStore.java
##########
@@ -188,6 +188,14 @@ public void flush() {
     }
   }
 
+  @Override
+  protected void finalize() throws Throwable {

Review comment:
       I don't think using finalize is a good idea.
   This will cause unpredictable performance impact, since each garbage collection may take an arbitrary time now.
   The services should be stopped as a part of stopped flow, not on garbage collection.

##########
File path: samza-core/src/main/java/org/apache/samza/coordinator/metadatastore/CoordinatorStreamStore.java
##########
@@ -188,6 +188,14 @@ public void flush() {
     }
   }
 
+  @Override

Review comment:
       
    preferred way of calling super.finalize should be:
   finalize() {
     try {
      .. stop...
   } finally {
     super.finalize();
   }
   }




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

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