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

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to