+1 (Non binding)
I had a go with this branch and it solved lots of weird concurrency errors.
Bryn
On 09/12/15 10:50, ASF GitHub Bot (JIRA) wrote:
[
https://issues.apache.org/jira/browse/TINKERPOP-1035?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15048472#comment-15048472
]
ASF GitHub Bot commented on TINKERPOP-1035:
-------------------------------------------
GitHub user spmallette opened a pull request:
https://github.com/apache/incubator-tinkerpop/pull/174
TINKERPOP-1035 Improved consistency of transaction management in gremlin
server.
https://issues.apache.org/jira/browse/TINKERPOP-1035
Sessionless requests now have special handling for `GraphTraversal` return results. Gremlin Server now force iterates those results (when they include `Mutating` steps) to a `List`. It then commits and then iterates that `List`. For all other results the commit occurs in the same spot, but doesn't force iterate which allows results to stream as they always have.
Tested manually and with:
```text
mvn clean install
mvn verify -DskipIntegrationTests=false -pl gremlin-server
```
VOTE: +1
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/apache/incubator-tinkerpop TINKERPOP-1035
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/incubator-tinkerpop/pull/174.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 #174
----
commit dbc7f94c343f5ca8d4e51c0354280b552c231967
Author: Stephen Mallette <[email protected]>
Date: 2015-12-09T00:50:18Z
Improved consistency of transaction management in gremlin server.
Sessionless requests now have special handling for GraphTraversal return results. Gremlin Server now force iterates those results (when they include Mutating steps) to a List. It then commits and then iterates that List. For all other results the commit occurs in the same spot, but doesn't force iterate which allows results to stream as they always have.
----
Better Consistency in Gremlin Server Transaction Management
------------------------------------------------------------
Key: TINKERPOP-1035
URL: https://issues.apache.org/jira/browse/TINKERPOP-1035
Project: TinkerPop
Issue Type: Improvement
Components: server
Affects Versions: 3.1.0-incubating
Reporter: stephen mallette
Assignee: stephen mallette
Fix For: 3.1.1-incubating
For sessionless requests, Gremlin Server currently calls commit after iteration
of results is complete. The problem is that if the user issues: {{g.addV()}}
then a graph may not have assigned proper identifiers at that point (or have
other issues) at the time of serialization. Gremlin Server also then spends
time sending back results (if it can) when a call to {{commit()}} will
ultimately fail.
A solution that seems to work is to move the {{commit()}} to occur after eval
but before iteration of results to the client. Moreover, if the result to be
iterated is a {{Traversal}} then we can check if it has {{Mutating}} steps and
if so, iterate it out first to {{List}}, call {{commit()}} and then iterate the
{{List}}. The obvious downside is that we lose streaming in these cases as the
result has to be held in memory.
For now, I think we need to take the downside as there aren't any other
solutions that work consistently across all graphs. For 3.2.x and forward we
can think of better fixes that might introduce some breaking change.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)