You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tinkerpop.apache.org by "Shaunak Das (JIRA)" <ji...@apache.org> on 2015/12/17 11:01:46 UTC
[jira] [Comment Edited] (TINKERPOP-1045) Client-Side Hangs when
attempting to access a HashMap with Keys of type Integer
[ https://issues.apache.org/jira/browse/TINKERPOP-1045?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15061819#comment-15061819 ]
Shaunak Das edited comment on TINKERPOP-1045 at 12/17/15 10:01 AM:
-------------------------------------------------------------------
This may be resolved by your fix to errors not propagating back to the client, but figured rather be safe than sorry. I intentionally exhaust the memory for the Gremlin Server by adding too many vertices to a TinkerGraph. With TP 3.1.0, we get a hang on the client-side when submitting the following:
{code}
gremlin> script = "for(int i = 0; i < 10000000; i++){graph.addVertex('label', i)}"
==>for(int i = 0; i < 10000000; i++){graph.addVertex('label', i)}
gremlin> client.submit(script).all().get()
{code}
Of course, how many vertices one adds will depend on what they set their heap size to. The server gives this expected message:
{code}
[WARN] GremlinExecutor - Timing out script - for(int i = 0; i < 10000000; i++){graph.addVertex('label', i)} - in thread [gremlin-server-worker-1]
Exception in thread "gremlin-server-boss-1" java.lang.OutOfMemoryError: GC overhead limit exceeded
{code}
was (Author: shaunakdas88):
This may be resolved by your fix to errors not propagating back to the client, but figured rather be safe than sorry. I intentionally exhaust the memory for the Gremlin Server by adding too many vertices to a TinkerGraph. With TP 3.1.0, we get a hang on the client-side when submitting the following:
{code}
gremlin> script = "for(int i = 0; i < 10000000; i++){graph.addVertex('label', i)}"
==>for(int i = 0; i < 10000000; i++){graph.addVertex('label', i)}
gremlin> client.submit(script).all().get()
Of course, how many vertices one adds will depend on what they set their heap size to. The server gives this expected message:
{code}
[WARN] GremlinExecutor - Timing out script - for(int i = 0; i < 10000000; i++){graph.addVertex('label', i)} - in thread [gremlin-server-worker-1]
Exception in thread "gremlin-server-boss-1" java.lang.OutOfMemoryError: GC overhead limit exceeded
> Client-Side Hangs when attempting to access a HashMap with Keys of type Integer
> -------------------------------------------------------------------------------
>
> Key: TINKERPOP-1045
> URL: https://issues.apache.org/jira/browse/TINKERPOP-1045
> Project: TinkerPop
> Issue Type: Improvement
> Components: server
> Affects Versions: 3.1.0-incubating
> Reporter: Shaunak Das
> Assignee: stephen mallette
> Priority: Minor
> Fix For: 3.1.1-incubating
>
>
> I try to use a HashMap that has keys of type Integer, and send the following request:
> {code}
> gremlin> map = [1: "hello", 2: 3]
> ==>1=hello
> ==>2=3
> gremlin> map[1]
> ==>hello
> gremlin> map[2]
> ==>3
> gremlin> client = Cluster.build().create().connect().alias("graph.g")
> ==>org.apache.tinkerpop.gremlin.driver.Client$ReboundClusteredClient@cda4919
> gremlin> client.submit('1+1').all().get()
> ==>result{object=2 class=java.lang.Integer}
> gremlin> client.submit('map[1]', map).all().get()
> The client-side ends up hanging. The Gremlin Server logs give this, which is to be expected, as explained to me by Stephen:
> WARN [gremlin-server-worker-1] 2015-12-16 00:34:26,609 Slf4JLogger.java:151 - 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.
> io.netty.handler.codec.DecoderException: java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.String
> at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:99) [netty-all-4.0.33.dse.jar:4.0.33.dse]
> at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:318) [netty-all-4.0.33.dse.jar:4.0.33.dse]
> at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:304) [netty-all-4.0.33.dse.jar:4.0.33.dse]
> at com.datastax.bdp.graph.plugin.GremlinServerGraphHandler.handleRequestMessage(GremlinServerGraphHandler.java:94) [dse-graph-5.0.0-DSP-5175.jar:5.0.0-DSP-5175]
> at com.datastax.bdp.graph.plugin.AbstractRequestMessageHandler.channelRead(AbstractRequestMessageHandler.java:62) [dse-graph-5.0.0-DSP-5175.jar:5.0.0-DSP-5175]
> at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:318) [netty-all-4.0.33.dse.jar:4.0.33.dse]
> at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:304) [netty-all-4.0.33.dse.jar:4.0.33.dse]
> at com.datastax.bdp.cassandra.audit.GremlinServerAuditLogRequestHandler.handleRequestMessage(GremlinServerAuditLogRequestHandler.java:32) [dse-graph-5.0.0-DSP-5175.jar:5.0.0-DSP-5175]
> at com.datastax.bdp.graph.plugin.AbstractRequestMessageHandler.channelRead(AbstractRequestMessageHandler.java:62) [dse-graph-5.0.0-DSP-5175.jar:5.0.0-DSP-5175]
> at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:318) [netty-all-4.0.33.dse.jar:4.0.33.dse]
> at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:304) [netty-all-4.0.33.dse.jar:4.0.33.dse]
> at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) [netty-all-4.0.33.dse.jar:4.0.33.dse]
> at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:318) [netty-all-4.0.33.dse.jar:4.0.33.dse]
> at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:304) [netty-all-4.0.33.dse.jar:4.0.33.dse]
> at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) [netty-all-4.0.33.dse.jar:4.0.33.dse]
> at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:318) [netty-all-4.0.33.dse.jar:4.0.33.dse]
> at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:304) [netty-all-4.0.33.dse.jar:4.0.33.dse]
> at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) [netty-all-4.0.33.dse.jar:4.0.33.dse]
> at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:318) [netty-all-4.0.33.dse.jar:4.0.33.dse]
> at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:304) [netty-all-4.0.33.dse.jar:4.0.33.dse]
> at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) [netty-all-4.0.33.dse.jar:4.0.33.dse]
> at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:318) [netty-all-4.0.33.dse.jar:4.0.33.dse]
> at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:304) [netty-all-4.0.33.dse.jar:4.0.33.dse]
> at io.netty.handler.codec.http.websocketx.WebSocketServerProtocolHandler$1.channelRead(WebSocketServerProtocolHandler.java:147) [netty-all-4.0.33.dse.jar:4.0.33.dse]
> at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:318) [netty-all-4.0.33.dse.jar:4.0.33.dse]
> at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:304) [netty-all-4.0.33.dse.jar:4.0.33.dse]
> at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:276) [netty-all-4.0.33.dse.jar:4.0.33.dse]
> at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:263) [netty-all-4.0.33.dse.jar:4.0.33.dse]
> at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:318) [netty-all-4.0.33.dse.jar:4.0.33.dse]
> at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:304) [netty-all-4.0.33.dse.jar:4.0.33.dse]
> at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:848) [netty-all-4.0.33.dse.jar:4.0.33.dse]
> at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:131) [netty-all-4.0.33.dse.jar:4.0.33.dse]
> at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:511) [netty-all-4.0.33.dse.jar:4.0.33.dse]
> at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:468) [netty-all-4.0.33.dse.jar:4.0.33.dse]
> at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:382) [netty-all-4.0.33.dse.jar:4.0.33.dse]
> at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:354) [netty-all-4.0.33.dse.jar:4.0.33.dse]
> at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:112) [netty-all-4.0.33.dse.jar:4.0.33.dse]
> at java.lang.Thread.run(Thread.java:745) [na:1.8.0_40]
> Caused by: java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.String
> at org.apache.tinkerpop.gremlin.server.op.AbstractEvalOpProcessor$$Lambda$451/1156928780.test(Unknown Source) ~[na:na]
> at java.util.stream.MatchOps$1MatchSink.accept(MatchOps.java:90) ~[na:1.8.0_40]
> at java.util.Spliterators$IteratorSpliterator.tryAdvance(Spliterators.java:1812) ~[na:1.8.0_40]
> at java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:126) ~[na:1.8.0_40]
> at java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:529) ~[na:1.8.0_40]
> at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:516) ~[na:1.8.0_40]
> at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:502) ~[na:1.8.0_40]
> at java.util.stream.MatchOps$MatchOp.evaluateSequential(MatchOps.java:230) ~[na:1.8.0_40]
> at java.util.stream.MatchOps$MatchOp.evaluateSequential(MatchOps.java:196) ~[na:1.8.0_40]
> at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[na:1.8.0_40]
> at java.util.stream.ReferencePipeline.anyMatch(ReferencePipeline.java:449) ~[na:1.8.0_40]
> at org.apache.tinkerpop.gremlin.server.op.AbstractEvalOpProcessor.validateEvalMessage(AbstractEvalOpProcessor.java:137) ~[gremlin-server-3.1.1-SNAPSHOT-20151209-e1624745.jar:3.1.1-SNAPSHOT-20151209-e1624745]
> at org.apache.tinkerpop.gremlin.server.op.AbstractEvalOpProcessor.select(AbstractEvalOpProcessor.java:114) ~[gremlin-server-3.1.1-SNAPSHOT-20151209-e1624745.jar:3.1.1-SNAPSHOT-20151209-e1624745]
> at com.datastax.bdp.graph.plugin.DseOpSelectorHandler.decode(DseOpSelectorHandler.java:83) ~[dse-graph-5.0.0-DSP-5175.jar:5.0.0-DSP-5175]
> at com.datastax.bdp.graph.plugin.DseOpSelectorHandler.decode(DseOpSelectorHandler.java:42) ~[dse-graph-5.0.0-DSP-5175.jar:5.0.0-DSP-5175]
> at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:89) [netty-all-4.0.33.dse.jar:4.0.33.dse]
> ... 37 common frames omitted
> {code}
> Any way to stop the hang on the client-side?
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)