You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@beam.apache.org by "Pablo Estrada (Jira)" <ji...@apache.org> on 2022/04/29 22:58:00 UTC

[jira] [Created] (BEAM-14387) DirectRunner does not update reference to currentRestriction when running in SDF

Pablo Estrada created BEAM-14387:
------------------------------------

             Summary: DirectRunner does not update reference to currentRestriction when running in SDF
                 Key: BEAM-14387
                 URL: https://issues.apache.org/jira/browse/BEAM-14387
             Project: Beam
          Issue Type: Bug
          Components: runner-direct
            Reporter: Pablo Estrada


I have an SDF implementation that looks like so:

 
{code:java}
class MyRestrictionTracker {
  MyRestriction restriction;

  currentRestriction() { return restriction; }

  tryClaim(MyPosition position) {
    this.restriction = new MyRestriction(position)
  }
}{code}
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:

 
{code:java}
class MyRestrictionTracker {
  MyRestriction restriction;

  currentRestriction() { return restriction; }

  tryClaim(MyPosition position) {
    this.restriction.position = position;
  }
}{code}
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 : )



--
This message was sent by Atlassian Jira
(v8.20.7#820007)