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 2022/06/05 01:06:45 UTC

[GitHub] [beam] damccorm opened a new issue, #21637: DirectRunner does not update reference to currentRestriction when running in SDF

damccorm opened a new issue, #21637:
URL: https://github.com/apache/beam/issues/21637

   I have an SDF implementation that looks like so:
   
    
   ```
   
   class MyRestrictionTracker {
     MyRestriction restriction;
   
     currentRestriction() { return restriction;
   }
   
     tryClaim(MyPosition position) {
       this.restriction = new MyRestriction(position)
     }
   }
   ```
   
   I ran this on the DirectRunner, and the restriction would never advance: It would get stuck on the very first value.
   
   I also ran this on DataflowRunner, and the problem did not exist there: This ran fine.
   
    
   
   I was able to fix this on the DirectRunner (it works well on Dataflow as well) by changing the restriction to be mutable. Something like this:
   
    
   ```
   
   class MyRestrictionTracker {
     MyRestriction restriction;
   
     currentRestriction() { return restriction;
   }
   
     tryClaim(MyPosition position) {
       this.restriction.position = position;
     }
   }
   ```
   
   This looks like an execution issue with SDF on DirectRunner: The DirectRunner is likely storing a reference to `currentRestriction()` and never updating it as it runs.
   
    
   
   I'm happy to fix this on the DirectRunner - I would just like to find pointers : )
   
   Imported from Jira [BEAM-14387](https://issues.apache.org/jira/browse/BEAM-14387). Original Jira may contain additional context.
   Reported by: pabloem.


-- 
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: github-unsubscribe@beam.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org