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/08/31 17:56:21 UTC

[GitHub] [beam] pabloem commented on a change in pull request #12702: [BEAM-10603] Fix BCJ termination conditions.

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



##########
File path: sdks/python/apache_beam/runners/interactive/background_caching_job.py
##########
@@ -87,11 +87,10 @@ def _should_end_condition_checker(self):
     return any([l.is_triggered() for l in self._limiters])
 
   def is_done(self):
-    is_terminated = self._pipeline_result.state is PipelineState.DONE
+    is_terminated = self._pipeline_result.state in (
+        PipelineState.DONE, PipelineState.CANCELLED)

Review comment:
       Ah this is odd indeed - this line must be hit by the test in capture_control_test.py, right? But codecov is marking it as not covered, correct?
   
   cc: @udim

##########
File path: sdks/python/apache_beam/runners/interactive/background_caching_job.py
##########
@@ -103,6 +102,7 @@ def cancel(self):
     if not PipelineState.is_terminal(self._pipeline_result.state):
       try:
         self._pipeline_result.cancel()
+        self._pipeline_result.wait_until_finish()

Review comment:
       I'm sure you've considered this, but just to be sure, have you given thought to other code assuming that this call is asynchronous?
   Also, might this pipeline run in an environment where a cancelation may take a long time? I guess it shouldnt be a problem generally?




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