[ 
https://issues.apache.org/jira/browse/TINKERPOP3-875?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14950107#comment-14950107
 ] 

Dylan Millikin edited comment on TINKERPOP3-875 at 10/9/15 9:08 AM:
--------------------------------------------------------------------

I made the following changes to your test (which represent my scenario). This 
fails, though oddly enough it fails with a different error so I'm wondering if 
I didn't make a mistake in writing it : 
https://github.com/PommeVerte/incubator-tinkerpop/commit/31f1bdeeced640c8b994320c97464805115cc059

The error is :

{code}
[WARN] Slf4JLogger - An exceptionCaught() event was fired, and it reached at 
the tail of the pipeline. It usually means the last handler in the pipeline did 
not handle the exception.
java.lang.IllegalStateException: Open a transaction before attempting to 
read/write the transaction
        at 
org.apache.tinkerpop.gremlin.structure.Transaction$Exceptions.transactionMustBeOpenToReadWrite(Transaction.java:143)
        at 
org.apache.tinkerpop.gremlin.structure.Transaction$READ_WRITE_BEHAVIOR$2.accept(Transaction.java:219)
        at 
org.apache.tinkerpop.gremlin.structure.Transaction$READ_WRITE_BEHAVIOR$2.accept(Transaction.java:216)
        at 
org.apache.tinkerpop.gremlin.structure.util.AbstractTransaction.rollback(AbstractTransaction.java:104)
        at 
org.apache.tinkerpop.gremlin.server.GraphManager.lambda$rollbackAll$29(GraphManager.java:99)
        at 
org.apache.tinkerpop.gremlin.server.GraphManager$$Lambda$144/550314730.accept(Unknown
 Source)
        at 
java.util.concurrent.ConcurrentHashMap$EntrySetView.forEach(ConcurrentHashMap.java:4795)
        at 
org.apache.tinkerpop.gremlin.server.GraphManager.rollbackAll(GraphManager.java:96)
        at 
org.apache.tinkerpop.gremlin.server.util.ServerGremlinExecutor.lambda$new$18(ServerGremlinExecutor.java:102)
        at 
org.apache.tinkerpop.gremlin.server.util.ServerGremlinExecutor$$Lambda$32/509358216.accept(Unknown
 Source)
        at 
org.apache.tinkerpop.gremlin.groovy.engine.GremlinExecutor.eval(GremlinExecutor.java:237)
        at 
org.apache.tinkerpop.gremlin.server.op.AbstractEvalOpProcessor.evalOpInternal(AbstractEvalOpProcessor.java:157)
        at 
org.apache.tinkerpop.gremlin.server.op.standard.StandardOpProcessor.evalOp(StandardOpProcessor.java:80)
        at 
org.apache.tinkerpop.gremlin.server.op.standard.StandardOpProcessor$$Lambda$140/393284483.accept(Unknown
 Source)
        at 
org.apache.tinkerpop.gremlin.server.handler.OpExecutorHandler.channelRead0(OpExecutorHandler.java:66)
        at 
org.apache.tinkerpop.gremlin.server.handler.OpExecutorHandler.channelRead0(OpExecutorHandler.java:41)
        at 
io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105)
        at 
io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:308)
        at 
io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:294)
        at 
io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103)
        at 
io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:308)
        at 
io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:294)
        at 
io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103)
        at 
io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:308)
        at 
io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:294)
        at 
io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103)
        at 
io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:308)
        at 
io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:294)
        at 
io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103)
        at 
io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:308)
        at 
io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:294)
        at 
io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103)
        at 
io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:308)
        at 
io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:294)
        at 
io.netty.handler.codec.http.websocketx.WebSocketServerProtocolHandler$1.channelRead(WebSocketServerProtocolHandler.java:146)
        at 
io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:308)
        at 
io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:294)
        at 
io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:244)
        at 
io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:308)
        at 
io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:294)
        at 
io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:846)
        at 
io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:131)
        at 
io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:511)
        at 
io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:468)
        at 
io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:382)
        at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:354)
        at 
io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:111)
        at java.lang.Thread.run(Thread.java:745)
{code}


was (Author: dmill):
I made the following changes to your test (which represent my scenario). This 
fails, though oddly enough it fails with a different error so I'm wondering if 
I didn't make a mistake in writing it : 
https://github.com/PommeVerte/incubator-tinkerpop/commit/31f1bdeeced640c8b994320c97464805115cc059

{code}
[WARN] Slf4JLogger - An exceptionCaught() event was fired, and it reached at 
the tail of the pipeline. It usually means the last handler in the pipeline did 
not handle the exception.
java.lang.IllegalStateException: Open a transaction before attempting to 
read/write the transaction
        at 
org.apache.tinkerpop.gremlin.structure.Transaction$Exceptions.transactionMustBeOpenToReadWrite(Transaction.java:143)
        at 
org.apache.tinkerpop.gremlin.structure.Transaction$READ_WRITE_BEHAVIOR$2.accept(Transaction.java:219)
        at 
org.apache.tinkerpop.gremlin.structure.Transaction$READ_WRITE_BEHAVIOR$2.accept(Transaction.java:216)
        at 
org.apache.tinkerpop.gremlin.structure.util.AbstractTransaction.rollback(AbstractTransaction.java:104)
        at 
org.apache.tinkerpop.gremlin.server.GraphManager.lambda$rollbackAll$29(GraphManager.java:99)
        at 
org.apache.tinkerpop.gremlin.server.GraphManager$$Lambda$144/550314730.accept(Unknown
 Source)
        at 
java.util.concurrent.ConcurrentHashMap$EntrySetView.forEach(ConcurrentHashMap.java:4795)
        at 
org.apache.tinkerpop.gremlin.server.GraphManager.rollbackAll(GraphManager.java:96)
        at 
org.apache.tinkerpop.gremlin.server.util.ServerGremlinExecutor.lambda$new$18(ServerGremlinExecutor.java:102)
        at 
org.apache.tinkerpop.gremlin.server.util.ServerGremlinExecutor$$Lambda$32/509358216.accept(Unknown
 Source)
        at 
org.apache.tinkerpop.gremlin.groovy.engine.GremlinExecutor.eval(GremlinExecutor.java:237)
        at 
org.apache.tinkerpop.gremlin.server.op.AbstractEvalOpProcessor.evalOpInternal(AbstractEvalOpProcessor.java:157)
        at 
org.apache.tinkerpop.gremlin.server.op.standard.StandardOpProcessor.evalOp(StandardOpProcessor.java:80)
        at 
org.apache.tinkerpop.gremlin.server.op.standard.StandardOpProcessor$$Lambda$140/393284483.accept(Unknown
 Source)
        at 
org.apache.tinkerpop.gremlin.server.handler.OpExecutorHandler.channelRead0(OpExecutorHandler.java:66)
        at 
org.apache.tinkerpop.gremlin.server.handler.OpExecutorHandler.channelRead0(OpExecutorHandler.java:41)
        at 
io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105)
        at 
io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:308)
        at 
io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:294)
        at 
io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103)
        at 
io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:308)
        at 
io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:294)
        at 
io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103)
        at 
io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:308)
        at 
io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:294)
        at 
io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103)
        at 
io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:308)
        at 
io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:294)
        at 
io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103)
        at 
io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:308)
        at 
io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:294)
        at 
io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103)
        at 
io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:308)
        at 
io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:294)
        at 
io.netty.handler.codec.http.websocketx.WebSocketServerProtocolHandler$1.channelRead(WebSocketServerProtocolHandler.java:146)
        at 
io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:308)
        at 
io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:294)
        at 
io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:244)
        at 
io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:308)
        at 
io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:294)
        at 
io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:846)
        at 
io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:131)
        at 
io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:511)
        at 
io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:468)
        at 
io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:382)
        at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:354)
        at 
io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:111)
        at java.lang.Thread.run(Thread.java:745)
{code}

> transaction commit() issue
> --------------------------
>
>                 Key: TINKERPOP3-875
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP3-875
>             Project: TinkerPop 3
>          Issue Type: Bug
>          Components: server
>            Reporter: Dylan Millikin
>            Assignee: stephen mallette
>
> I'm still experiencing issue with transactions (working my way from the titan 
> bug). The following series of requests to gremlin server fail on the last 
> {{tx().open()}} because of some issue with transaction management.
> I've included all the information I have in the form of the log and the 
> requests. They're all short enough to go through easily.
> I'm also using a 3.0.2 snapshot that outdates the changes that were made to 
> session management (as can be noticed by the last request with an {{op}} of 
> {{close}})
> {{GraphT}} and {{t}} refer to a neo4j graph and it's corresponding traversal.
> Here's the full succession of requests (create two vertices in a transaction, 
> fetch them and delete them in another transaction):
> {code}
> {"requestId":"5d1790dc-5ae0-4926-bc67-8736adbde576","processor":"session","op":"eval","args":{"gremlin":"graphT.tx().open()","session":"bc1c71e5-4122-4829-a349-0c9a8c0df5bd"}}
> {"requestId":"bb0b6981-7d5e-4552-a964-f1b91b08bbe4","processor":"session","op":"eval","args":{"gremlin":"t.addV().property(B_KEY_NAME,B_KEYVALUE_NAME).property(B_KEY_AGE,B_KEYVALUE_AGE)","bindings":{"B_KEY_NAME":"name","B_KEYVALUE_NAME":"john","B_KEY_AGE":"age","B_KEYVALUE_AGE":27},"session":"bc1c71e5-4122-4829-a349-0c9a8c0df5bd"}}
> {"requestId":"37c133ab-195b-43d9-bb6a-c3b6e41e1396","processor":"session","op":"eval","args":{"gremlin":"t.addV().property(B_KEY_NAME,B_KEYVALUE_NAME).property(B_KEY_AGE,B_KEYVALUE_AGE)","bindings":{"B_KEY_NAME":"name","B_KEYVALUE_NAME":"john","B_KEY_AGE":"age","B_KEYVALUE_AGE":27},"session":"bc1c71e5-4122-4829-a349-0c9a8c0df5bd"}}
> {"requestId":"3cf7a392-4090-40a2-bb33-1b89e731cf03","processor":"session","op":"eval","args":{"gremlin":"graphT.tx().commit()","session":"bc1c71e5-4122-4829-a349-0c9a8c0df5bd"}}
> {"requestId":"d641b90e-d746-4c44-87e4-226171a2bb44","processor":"","op":"eval","args":{"gremlin":"t.V(B_R_ID).range(0,1)","bindings":{"B_R_ID":168}}}
> {"requestId":"b22267fb-49a3-4525-aa5c-938a9f7221cf","processor":"","op":"eval","args":{"gremlin":"t.V(B_R_ID).range(0,1)","bindings":{"B_R_ID":162}}}
> // 5 second sleep
> {"requestId":"67512bb9-14ab-42c4-9135-5e279a45fd11","processor":"session","op":"eval","args":{"gremlin":"graphT.tx().open()","session":"bc1c71e5-4122-4829-a349-0c9a8c0df5bd"}}
> {"requestId":"55bbffa2-8bf2-4a2a-971a-c9b2efb9d183","processor":"session","op":"close","args":{"gremlin":"","session":"bc1c71e5-4122-4829-a349-0c9a8c0df5bd"}}
> {code}
> Here's the full server log from start to finish:
> {code}
> [INFO] Session - New session established for 
> bc1c71e5-4122-4829-a349-0c9a8c0df5bd
> [INFO] ScriptEngines - Loaded nashorn ScriptEngine
> [INFO] ScriptEngines - Loaded gremlin-groovy ScriptEngine
> [INFO] GremlinExecutor - Initialized gremlin-groovy ScriptEngine with 
> scripts/gremlin-php-script.groovy
> [WARN] AbstractEvalOpProcessor - Exception processing a script on request 
> [RequestMessage{, requestId=67512bb9-14ab-42c4-9135-5e279a45fd11, op='eval', 
> processor='session', args={gremlin=graphT.tx().open(), 
> session=bc1c71e5-4122-4829-a349-0c9a8c0df5bd}}].
> java.lang.IllegalStateException: Stop the current transaction before opening 
> another
>       at 
> org.apache.tinkerpop.gremlin.structure.Transaction$Exceptions.transactionAlreadyOpen(Transaction.java:139)
>       at 
> org.apache.tinkerpop.gremlin.structure.util.AbstractTransaction.open(AbstractTransaction.java:85)
>       at org.apache.tinkerpop.gremlin.structure.Transaction$open.call(Unknown 
> Source)
>       at Script2.run(Script2.groovy:1)
>       at 
> org.apache.tinkerpop.gremlin.groovy.jsr223.GremlinGroovyScriptEngine.eval(GremlinGroovyScriptEngine.java:525)
>       at 
> org.apache.tinkerpop.gremlin.groovy.jsr223.GremlinGroovyScriptEngine.eval(GremlinGroovyScriptEngine.java:365)
>       at javax.script.AbstractScriptEngine.eval(AbstractScriptEngine.java:233)
>       at 
> org.apache.tinkerpop.gremlin.groovy.engine.ScriptEngines.eval(ScriptEngines.java:96)
>       at 
> org.apache.tinkerpop.gremlin.groovy.engine.GremlinExecutor.lambda$eval$7(GremlinExecutor.java:244)
>       at 
> org.apache.tinkerpop.gremlin.groovy.engine.GremlinExecutor$$Lambda$110/1114839633.call(Unknown
>  Source)
>       at java.util.concurrent.FutureTask.run(FutureTask.java:266)
>       at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
>       at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
>       at java.lang.Thread.run(Thread.java:745)
> [INFO] Session - Rolling back open transactions on graphT before killing 
> session: bc1c71e5-4122-4829-a349-0c9a8c0df5bd
> [INFO] Session - Session bc1c71e5-4122-4829-a349-0c9a8c0df5bd closed
> {code}
> Any ideas where to start looking?



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to