You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by GitBox <gi...@apache.org> on 2021/11/29 10:40:20 UTC

[GitHub] [beam] echauchot commented on a change in pull request #15955: [BEAM-13236] Properly close kinesis producer on teardown

echauchot commented on a change in pull request #15955:
URL: https://github.com/apache/beam/pull/15955#discussion_r758236444



##########
File path: sdks/java/io/kinesis/src/main/java/org/apache/beam/sdk/io/kinesis/KinesisIO.java
##########
@@ -1067,8 +1063,11 @@ private void checkForFailures(String message) throws IOException {
 
       @Teardown
       public void teardown() throws Exception {
-        if (producer != null && producer.getOutstandingRecordsCount() > 0) {
-          producer.flushSync();
+        if (producer != null) {
+          if (producer.getOutstandingRecordsCount() > 0) {
+            producer.flushSync();
+          }
+          producer.destroy();
         }
         producer = null;

Review comment:
       > 
   
   One reason that could explain that it works is that some execution engines write at parallelism one resulting into a single instance of the write DoFn




-- 
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: github-unsubscribe@beam.apache.org

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