Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.0.2-incubating
    • 3.2.2
    • process
    • None

    Description

      In the following traversal, I can see (via the println) that the store executes, but the select inside the until does not seem to see it. The result is an infinite loop.

      g = TinkerFactory.createModern().traversal();
      g.V().until(
          or(values('name').is('marko'),
             sideEffect{it ->
                 System.err.println('until:' + it.get());
                 System.err.println(it.getClass().getSimpleName());
                 System.err.println(it.getSideEffects());
             }
             .select('x'))).
      repeat(both()).
      store('x').
      sideEffect{it ->
          System.err.println('done:' + it.get());
          System.err.println(it.getSideEffects());
          System.err.println(it.getSideEffects().get('x'));
      }.
      count()
      

      Here are the first few lines of output:

      done:v[1]
      sideEffects[size:1]
      Optional[{v[1]=1}]
      until:v[2]
      B_O_S_SE_SL_Traverser
      sideEffects[size:0]
      done:v[1]
      sideEffects[size:1]
      Optional[{v[1]=2}]
      until:v[3]
      B_O_S_SE_SL_Traverser
      sideEffects[size:0]
      done:v[1]
      sideEffects[size:1]
      Optional[{v[1]=3}]
      ...
      

      Attachments

        Activity

          I think I might know the issue, but can you provide a simpler example. Is it specific to until?

          okram Marko A. Rodriguez added a comment - I think I might know the issue, but can you provide a simpler example. Is it specific to until ?
          mhfrantz Matt Frantz added a comment -

          I worked pretty hard to make this repro fit on one page, as it occurred in a much, much larger context originally. If you remove the sideEffect debugging steps, it's not that long, is it? I don't know what the key elements are.

          mhfrantz Matt Frantz added a comment - I worked pretty hard to make this repro fit on one page, as it occurred in a much, much larger context originally. If you remove the sideEffect debugging steps, it's not that long, is it? I don't know what the key elements are.
          dkuppitz Daniel Kuppitz added a comment -

          I honestly don't know why, but the inner traversals are not aware of sideeffects of the outer traversal. However, the outer traversal is aware of sideeffects created by the inner traversals. Hence there's a pretty simple fix:

          g.V().until(or(values('name').is('marko').store('x'),
                         select('x'))).repeat(both()).count()
          
          dkuppitz Daniel Kuppitz added a comment - I honestly don't know why, but the inner traversals are not aware of sideeffects of the outer traversal. However, the outer traversal is aware of sideeffects created by the inner traversals. Hence there's a pretty simple fix: g.V().until(or(values( 'name' ).is( 'marko' ).store( 'x' ), select( 'x' ))).repeat(both()).count()
          dkuppitz Daniel Kuppitz added a comment -

          This was fixed somewhere else (works in 3.2.2).

          dkuppitz Daniel Kuppitz added a comment - This was fixed somewhere else (works in 3.2.2).

          People

            dkuppitz Daniel Kuppitz
            mhfrantz Matt Frantz
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: