You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tinkerpop.apache.org by ml86 <gi...@git.apache.org> on 2017/05/03 09:19:07 UTC

[GitHub] tinkerpop pull request #606: Corrected copy-paste error in until step for pr...

GitHub user ml86 opened a pull request:

    https://github.com/apache/tinkerpop/pull/606

    Corrected copy-paste error in until step for predicates.

    Correct me if I am wrong, but I think the use of `addEmitToTraversal` in `until` step causes unintended traverser splits.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/ShiftLeftSecurity/tinkerpop master

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/tinkerpop/pull/606.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #606
    
----
commit acf2992fcbabc60f883531a5c75e4468a10079c8
Author: Markus Lottmann <ma...@shiftleft.io>
Date:   2017-05-03T09:09:28Z

    Corrected copy-paste error in until step for predicates.

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] tinkerpop issue #606: Corrected copy-paste error in until step for predicate...

Posted by okram <gi...@git.apache.org>.
Github user okram commented on the issue:

    https://github.com/apache/tinkerpop/pull/606
  
    You need splits so the traverser remains "local" to the child branch. I think your fix for this particular problem is correct, it would be great if you could also add a test case to `RepeatTest` that uses the updated method (and show to yourself that it fails without your change). From there we can VOTE and merge your fix.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] tinkerpop issue #606: Corrected copy-paste error in until step for predicate...

Posted by ml86 <gi...@git.apache.org>.
Github user ml86 commented on the issue:

    https://github.com/apache/tinkerpop/pull/606
  
    I continued to read the code and it turned auto that my initial assumption that the traverser split was caused by the use of addEmitToTraversal was wrong. The split would occur anyway since RepeatStep::doUntil calls TraversalUtil.test() which always splits the traverser. 
    This brings me to the question: Are the splits made in TraversalUtil::test, TraversalUtil::apply and TraversalUtil::applyAll really necessary? As far as I understand the code the traversal given to those functions would anyway split if necessary (e.g. a map step). But by always splitting in the 3 mentioned methods you also do it for e.g. the LambdaFilterStep which does seem unnecessary and, more importantly, prevents user from accessing/modifying the original traverser and the corresponding sack.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] tinkerpop issue #606: Corrected copy-paste error in until step for predicate...

Posted by mpollmeier <gi...@git.apache.org>.
Github user mpollmeier commented on the issue:

    https://github.com/apache/tinkerpop/pull/606
  
    Thanks Marko!


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] tinkerpop issue #606: Corrected copy-paste error in until step for predicate...

Posted by spmallette <gi...@git.apache.org>.
Github user spmallette commented on the issue:

    https://github.com/apache/tinkerpop/pull/606
  
    Did this problem exist in 3.1.x? If so, perhaps it should be fixed back in tp31....


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] tinkerpop issue #606: Corrected copy-paste error in until step for predicate...

Posted by okram <gi...@git.apache.org>.
Github user okram commented on the issue:

    https://github.com/apache/tinkerpop/pull/606
  
    It must effect semantics as `until` is different from `emit`. ?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] tinkerpop issue #606: Corrected copy-paste error in until step for predicate...

Posted by okram <gi...@git.apache.org>.
Github user okram commented on the issue:

    https://github.com/apache/tinkerpop/pull/606
  
    Please see https://github.com/apache/tinkerpop/pull/615 . Here is what I did:
    
    1. Created a JIRA first.
    2. Fixed the problem.
    3. Created a test case that fails with the problem, but succeeds with the fix.
    
    Note that the problem was in `until(Predicate)` which is a lambda and thus your example using `has("x",2)` isn't calling the broken method -- its calling `until(Traversal)`. Please see the test case in my PR (#615) and note the lambda usage. Without the fix, `emit()` would be called instead an an infinite loop occurs.



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] tinkerpop pull request #606: Corrected copy-paste error in until step for pr...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/tinkerpop/pull/606


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] tinkerpop issue #606: Corrected copy-paste error in until step for predicate...

Posted by mpollmeier <gi...@git.apache.org>.
Github user mpollmeier commented on the issue:

    https://github.com/apache/tinkerpop/pull/606
  
    I spoke to @ml86 (we are colleagues) and we think that this error doesn't actually change the functionality. It only leads to computational overhead. But that makes it hard to write a test for. Since it's a very obvious copy/pasta error, I'd say let's just merge it as is. 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] tinkerpop issue #606: Corrected copy-paste error in until step for predicate...

Posted by okram <gi...@git.apache.org>.
Github user okram commented on the issue:

    https://github.com/apache/tinkerpop/pull/606
  
    Whoa!? That is a huge problem. Can you do three things for this please?
    
    1. Can you write a test case in `RepeatTest` that shows it breaking, but with your fix, it working.
    2. Can you direct your PR to `tp32/` branch, not `master/`.
    3. Can you update our `upgrade.asciidoc` if need be to say that there was a "breaking" change due to a break?
    



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] tinkerpop issue #606: Corrected copy-paste error in until step for predicate...

Posted by mpollmeier <gi...@git.apache.org>.
Github user mpollmeier commented on the issue:

    https://github.com/apache/tinkerpop/pull/606
  
    In theory, yes. But it seems to behave fine as it is. Here's a scenario for the gremlin-groovy shell:
    
    ```
    g = TinkerGraph.open()
    v0 = g.addVertex("x", 1)
    v1 = g.addVertex("x", 2)
    v2 = g.addVertex("x", 2)
    v0.addEdge("edge", v1)
    v1.addEdge("edge", v2)
    g.traversal().V(v0.id).repeat(out()).until(has("x", 2)).path()
    ```
    
    If `until` would incorrectly behave like `emit`, I would assume that we'd see all three nodes in the path. Instead we only see v0 and v1, which is the correct behavious for repeat/until. Is our scenario missing something?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] tinkerpop issue #606: Corrected copy-paste error in until step for predicate...

Posted by spmallette <gi...@git.apache.org>.
Github user spmallette commented on the issue:

    https://github.com/apache/tinkerpop/pull/606
  
    You don't run `gremlin-test` module. That just contains the tests themselves. You need to run a `Graph` implementation that uses `gremlin-test`, like `tinkergraph-gremlin`. I think that's your problem. 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] tinkerpop issue #606: Corrected copy-paste error in until step for predicate...

Posted by ml86 <gi...@git.apache.org>.
Github user ml86 commented on the issue:

    https://github.com/apache/tinkerpop/pull/606
  
    I am not able to get the test setup running for developing the requested tests. I tried : 
    ```
    export GREMLIN_TESTS='org.apache.tinkerpop.gremlin.process.traversal.step.branch.RepeatTest$Traversals'
    mvn -Dmaven.javadoc.skip=true --projects gremlin-test test
    ```
    But that does not executes org.apache.tinkerpop.gremlin.structure.ExceptionCoverageTest. So I am stuck and cannot proceed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---