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

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

                Author: ASF GitHub Bot
            Created on: 14/Jul/20 17:38
            Start Date: 14/Jul/20 17:38
    Worklog Time Spent: 10m 
      Work Description: boyuanzz commented on a change in pull request #12241:
URL: https://github.com/apache/beam/pull/12241#discussion_r454528596



##########
File path: sdks/python/apache_beam/runners/common.py
##########
@@ -842,29 +847,37 @@ def _invoke_process_per_window(self,
 
   def try_split(self, fraction):
     # type: (...) -> Optional[Tuple[SplitResultPrimary, SplitResultResidual]]
-    if self.threadsafe_restriction_tracker and self.current_windowed_value:
+    if not self.is_splittable:
+      return None
+
+    with self.splitting_lock:
+      # Make a local reference to member variables that change references 
during
+      # processing under lock before attempting to split so we have a 
consistent
+      # view of all the references.
+      current_windowed_value = self.current_windowed_value
+      threadsafe_restriction_tracker = self.threadsafe_restriction_tracker
+      threadsafe_watermark_estimator = self.threadsafe_watermark_estimator
+
+    if threadsafe_restriction_tracker:

Review comment:
       I would add a comment above to state the assumption. But it's minor 
though.




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


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

    Worklog Id:     (was: 458818)
    Time Spent: 5.5h  (was: 5h 20m)

> PerWindowInvoker to handle window observing SplittableDoFns
> -----------------------------------------------------------
>
>                 Key: BEAM-10420
>                 URL: https://issues.apache.org/jira/browse/BEAM-10420
>             Project: Beam
>          Issue Type: Improvement
>          Components: sdk-py-harness
>            Reporter: Luke Cwik
>            Assignee: Luke Cwik
>            Priority: P2
>              Labels: portability
>          Time Spent: 5.5h
>  Remaining Estimate: 0h
>
> Currently the FnApiDoFnRunner processes each element within it's own window. 
> There is an easy optimization where we process the element once if and only 
> if the function doesn't observe the window (either directly or indirectly via 
> side inputs/state/...).



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to