[ 
https://issues.apache.org/jira/browse/BEAM-13236?focusedWorklogId=687874&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-687874
 ]

ASF GitHub Bot logged work on BEAM-13236:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 30/Nov/21 09:33
            Start Date: 30/Nov/21 09:33
    Worklog Time Spent: 10m 
      Work Description: echauchot commented on a change in pull request #15955:
URL: https://github.com/apache/beam/pull/15955#discussion_r759089987



##########
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:
       To the execution engine, a writer is a native `map` that calls the Beam 
`ParDo` that runs the `DoFn`. The engine instanciates the `map` and for each 
map there is only one `DoFn`, so if the engine choses parallelism 1 for `map`, 
it will result in a single `DoFn`. In a nutshell, Beam never controls 
parallelism, it is always the choice of the engine




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


Issue Time Tracking
-------------------

    Worklog Id:     (was: 687874)
    Time Spent: 4h 40m  (was: 4.5h)

> Properly close kinesis producer on teardown
> -------------------------------------------
>
>                 Key: BEAM-13236
>                 URL: https://issues.apache.org/jira/browse/BEAM-13236
>             Project: Beam
>          Issue Type: Task
>          Components: io-java-kinesis
>            Reporter: Moritz Mack
>            Assignee: Moritz Mack
>            Priority: P2
>              Labels: aws, ios, kinesis
>          Time Spent: 4h 40m
>  Remaining Estimate: 0h
>
> Each KPL producer uses it's own native deamon, so properly cleaning up once 
> not used anymore is important.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to