robertwb commented on a change in pull request #11314: [BEAM-9562] Send Timers 
over Data Channel as Elements
URL: https://github.com/apache/beam/pull/11314#discussion_r406473230
 
 

 ##########
 File path: 
sdks/python/apache_beam/runners/portability/fn_api_runner/fn_runner.py
 ##########
 @@ -914,6 +926,17 @@ def process_bundle(self,
 
     split_manager = self._select_split_manager()
     if not split_manager:
+      # Send the fired timers if any.
+      for (transform_id, timer_family_id), timers in fired_timers.items():
+        self._send_timers_to_worker(
+            process_bundle_id, transform_id, timer_family_id, timers)
+
+      for transform_id, timer_family_id in (
+          set(expected_output_timers.keys()) - set(fired_timers.keys())):
+        # Close the stream if there is no timers to be sent.
 
 Review comment:
   This is a subtle point. I might write something like "The worker waits for a 
logical timer stream to be closed for every possible timer, regardless of 
whether there are any timers to be sent."
   
   Maybe it'd be clearer to iterate over `expected_output_timers`, and send 
`fired_timers.get((transform_id, timer_family_id), [])`. 

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to