[
https://issues.apache.org/jira/browse/TINKERPOP-2029?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16610714#comment-16610714
]
ASF GitHub Bot commented on TINKERPOP-2029:
-------------------------------------------
GitHub user dkuppitz opened a pull request:
https://github.com/apache/tinkerpop/pull/931
TINKERPOP-2029 ConcurrentModificationException for InlineFilterStrategy
https://issues.apache.org/jira/browse/TINKERPOP-2029
To fix the original issue, I basically rewrote `ConnectiveStrategy`. The
infix notation of `and()` and `or()` now supports an arbitrary number of
traversals and `ConnectiveStrategy` produces a traversal with correct `AND` and
`OR` semantics.
The reason for targeting `master/` is that there were no strict semantics
before and thus this needs to be considered a breaking change.
```
# BEHAVIOR
Input: a.or.b.and.c.or.d.and.e.or.f.and.g.and.h.or.i
## BEFORE
Output: or(a, or(and(b, c), or(and(d, e), or(and(and(f, g), h), i))))
## NOW
Output: or(a, and(b, c), and(d, e), and(f, g, h), i)
```
`docker/build.sh -t -i -n` passed.
VOTE +1
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/apache/tinkerpop TINKERPOP-2029-master
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/tinkerpop/pull/931.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 #931
----
commit 46ee42686a875baf123176040b2f341218e02e1a
Author: Stephen Mallette <spmva@...>
Date: 2018-09-05T17:08:01Z
TINKERPOP-2029 Added tests demonstrating strategy failures
Identified potentially two problems, one with ConnectedStrategy and by
virtue of its application InlineFilterStrategy.
commit e518c9af9a4aca56449af2b743f24d35a8a43b50
Author: Daniel Kuppitz <daniel_kuppitz@...>
Date: 2018-09-10T18:41:34Z
Rewrote `ConnectiveStrategy`. It's a breaking change as it now behaves
slightly differently, but now it
* produces correct AND and OR semantics.
* has fewer recursive calls (at most 1).
* is faster in its own execution and produces fewer steps in the final
traversal which should make the processed traversal faster as well.
commit 2ce9a6def3426b2a2ff89e6b556ae8b2653f6098
Author: Daniel Kuppitz <daniel_kuppitz@...>
Date: 2018-09-10T18:47:46Z
Merge branch 'TINKERPOP-2029' into TINKERPOP-2029-master
commit 9330fcbc477e6a64649b6c6aa22f697756d31140
Author: Daniel Kuppitz <daniel_kuppitz@...>
Date: 2018-09-10T18:49:52Z
Removed note about infix restriction for `and()` and `or()` as they are no
longer existent.
commit 40b21bbd1361712c7b3cef140773ea87da30dbd0
Author: Daniel Kuppitz <daniel_kuppitz@...>
Date: 2018-09-10T19:21:17Z
updated docs
----
> ConcurrentModificationException for InlineFilterStrategy
> --------------------------------------------------------
>
> Key: TINKERPOP-2029
> URL: https://issues.apache.org/jira/browse/TINKERPOP-2029
> Project: TinkerPop
> Issue Type: Bug
> Components: process
> Affects Versions: 3.2.9
> Reporter: stephen mallette
> Assignee: Daniel Kuppitz
> Priority: Minor
>
> {code}
> gremlin> g.V().has("name", "marko").and().has("name",
> "marko").and().has("name", "marko")
> java.util.ConcurrentModificationException
> Type ':help' or ':h' for help.
> Display stack trace? [yN]y
> java.util.ConcurrentModificationException
> at java.util.ArrayList$Itr.checkForComodification(ArrayList.java:909)
> at java.util.ArrayList$Itr.next(ArrayList.java:859)
> at
> java.util.Collections$UnmodifiableCollection$1.next(Collections.java:1042)
> at
> org.apache.tinkerpop.gremlin.process.traversal.strategy.optimization.InlineFilterStrategy.processHasStep(InlineFilterStrategy.java:114)
> at
> org.apache.tinkerpop.gremlin.process.traversal.strategy.optimization.InlineFilterStrategy.apply(InlineFilterStrategy.java:93)
> at
> org.apache.tinkerpop.gremlin.process.traversal.util.TraversalHelper.applySingleLevelStrategies(TraversalHelper.java:696)
> at
> org.apache.tinkerpop.gremlin.process.traversal.strategy.optimization.InlineFilterStrategy.processAndStep(InlineFilterStrategy.java:248)
> at
> org.apache.tinkerpop.gremlin.process.traversal.strategy.optimization.InlineFilterStrategy.apply(InlineFilterStrategy.java:96)
> at
> org.apache.tinkerpop.gremlin.process.traversal.util.DefaultTraversalStrategies.applyStrategies(DefaultTraversalStrategies.java:86)
> at
> org.apache.tinkerpop.gremlin.process.traversal.util.DefaultTraversal.applyStrategies(DefaultTraversal.java:119)
> at
> org.apache.tinkerpop.gremlin.process.traversal.util.DefaultTraversal.hasNext(DefaultTraversal.java:191)
> at
> org.apache.tinkerpop.gremlin.console.Console$_closure3.doCall(Console.groovy:239)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:498)
> at
> org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:98)
> at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
> at
> org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:264)
> at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1034)
> at
> org.codehaus.groovy.tools.shell.Groovysh.setLastResult(Groovysh.groovy:460)
> at org.codehaus.groovy.tools.shell.Groovysh.execute(Groovysh.groovy:196)
> at
> org.apache.tinkerpop.gremlin.console.GremlinGroovysh.super$3$execute(GremlinGroovysh.groovy)
> at sun.reflect.GeneratedMethodAccessor14.invoke(Unknown Source)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:498)
> at
> org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:98)
> at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
> at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1225)
> at
> org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuperN(ScriptBytecodeAdapter.java:145)
> at
> org.apache.tinkerpop.gremlin.console.GremlinGroovysh.execute(GremlinGroovysh.groovy:72)
> at org.codehaus.groovy.tools.shell.Shell.leftShift(Shell.groovy:122)
> at
> org.codehaus.groovy.tools.shell.ShellRunner.work(ShellRunner.groovy:95)
> at
> org.codehaus.groovy.tools.shell.InteractiveShellRunner.super$2$work(InteractiveShellRunner.groovy)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:498)
> at
> org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:98)
> at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
> at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1225)
> at
> org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuperN(ScriptBytecodeAdapter.java:145)
> at
> org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuper0(ScriptBytecodeAdapter.java:165)
> at
> org.codehaus.groovy.tools.shell.InteractiveShellRunner.work(InteractiveShellRunner.groovy:130)
> at
> org.codehaus.groovy.tools.shell.ShellRunner.run(ShellRunner.groovy:59)
> at
> org.codehaus.groovy.tools.shell.InteractiveShellRunner.super$2$run(InteractiveShellRunner.groovy)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:498)
> at
> org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:98)
> at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
> at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1225)
> at
> org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuperN(ScriptBytecodeAdapter.java:145)
> at
> org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuper0(ScriptBytecodeAdapter.java:165)
> at
> org.codehaus.groovy.tools.shell.InteractiveShellRunner.run(InteractiveShellRunner.groovy:89)
> at
> org.codehaus.groovy.vmplugin.v7.IndyInterface.selectMethod(IndyInterface.java:236)
> at
> org.apache.tinkerpop.gremlin.console.Console.<init>(Console.groovy:171)
> at
> org.codehaus.groovy.vmplugin.v7.IndyInterface.selectMethod(IndyInterface.java:236)
> at org.apache.tinkerpop.gremlin.console.Console.main(Console.groovy:483)
> {code}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)