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 2020/04/28 21:05:47 UTC

[GitHub] [beam] pabloem commented on a change in pull request #11492: [BEAM-9801] Pass in fire timestamp to timer callback

pabloem commented on a change in pull request #11492:
URL: https://github.com/apache/beam/pull/11492#discussion_r416921999



##########
File path: sdks/python/apache_beam/runners/portability/fn_api_runner/fn_runner.py
##########
@@ -845,10 +845,12 @@ def process_bundle(self,
           (result_future.is_done() and result_future.get().error)):
         if isinstance(output, beam_fn_api_pb2.Elements.Timers) and not dry_run:
           with BundleManager._lock:
-            self.bundle_context_manager.get_buffer(
+            timer_buffer = self.bundle_context_manager.get_buffer(
                 expected_output_timers[(
                     output.transform_id, output.timer_family_id)],
-                output.transform_id).append(output.timers)
+                output.transform_id)
+            timer_buffer.cleared = False

Review comment:
       Did you run into these errors when setting a timer from the timer call, Max? I think it would be good to explicitly reset the buffer, rather than manipulate its flag (e.g. write a timer_buffer.reset function). Or at least check `if timer_buffer.cleared: timer_buffer.cleared = False`, to confirm that the rest of the internal context in `ListBuffer` is cleared.




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