opencypher / cypher-for-gremlin

Cypher for Gremlin adds Cypher support to any Gremlin graph database.
Apache License 2.0
356 stars 48 forks source link

Cypher query scriptEvaluationTimeout in 30s #348

Open SarthakGhosh16 opened 4 years ago

SarthakGhosh16 commented 4 years ago

@dwitry The issue is regarding #316 #335

Previously we were using JS 0.3.x and hence I couldn't test out this update but now we have moved to JS 0.4.1 and cypher-gremlin-server-plugin-1.0.3-all.jar which has the change for scriptEvaluationTimeout https://github.com/opencypher/cypher-for-gremlin/pull/316

On updating this, I found that now the script gets terminated in 30s (default value in the code)

In my gremlin-server.yaml, I have this value set to 120s but this is not being followed. I'm attaching my gremlin-server.yaml below.

host: 0
port: 8182
scriptEvaluationTimeout: 120000
channelizer: org.apache.tinkerpop.gremlin.server.channel.WsAndHttpChannelizer
threadPoolWorker: 16
gremlinPool: 32
graphs: {
  graph: conf/janusgraph-hbase.properties
}
scriptEngines: {
  gremlin-groovy: {
    plugins: { org.janusgraph.graphdb.tinkerpop.plugin.JanusGraphGremlinPlugin: {},
               org.apache.tinkerpop.gremlin.server.jsr223.GremlinServerGremlinPlugin: {},
               org.apache.tinkerpop.gremlin.tinkergraph.jsr223.TinkerGraphGremlinPlugin: {},
               org.apache.tinkerpop.gremlin.jsr223.ImportGremlinPlugin: {classImports: [java.lang.Math,org.opencypher.gremlin.traversal.CustomFunctions,org.opencypher.gremlin.traversal.CustomPredicate], methodImports: [java.lang.Math#*,org.opencypher.gremlin.traversal.CustomPredicate#*,org.opencypher.gremlin.traversal.CustomFunctions#*]},
               org.apache.tinkerpop.gremlin.jsr223.ScriptFileGremlinPlugin: {files: [scripts/empty-sample.groovy]}},
    scripts: [scripts/empty-sample.groovy], 
    staticImports: ['org.opencypher.gremlin.process.traversal.CustomPredicates.*','org..opencypher.gremlin.traversal.CustomFunctions.*']}}
serializers:
  - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV3d0, config: { ioRegistries: [org.janusgraph.graphdb.tinkerpop.JanusGraphIoRegistry,org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerIoRegistryV3d0] }}
  - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV3d0, config: { serializeResultToString: true }}
  - { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV3d0, config: { ioRegistries: [org.janusgraph.graphdb.tinkerpop.JanusGraphIoRegistry] }}
  # Older serialization versions for backwards compatibility:
  - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0, config: { ioRegistries: [org.janusgraph.graphdb.tinkerpop.JanusGraphIoRegistry] }}
  - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoLiteMessageSerializerV1d0, config: {ioRegistries: [org.janusgraph.graphdb.tinkerpop.JanusGraphIoRegistry] }}
  - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0, config: { serializeResultToString: true }}
  - { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerGremlinV2d0, config: { ioRegistries: [org.janusgraph.graphdb.tinkerpop.JanusGraphIoRegistry] }}
  - { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerGremlinV1d0, config: { ioRegistries: [org.janusgraph.graphdb.tinkerpop.JanusGraphIoRegistryV1d0] }}
  - { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV1d0, config: { ioRegistries: [org.janusgraph.graphdb.tinkerpop.JanusGraphIoRegistryV1d0] }}
processors:
  - { className: org.apache.tinkerpop.gremlin.server.op.session.SessionOpProcessor, config: { sessionTimeout: 28800000 }}
  - { className: org.apache.tinkerpop.gremlin.server.op.traversal.TraversalOpProcessor, config: { cacheExpirationTime: 600000, cacheMaxSize: 1000 }}
  - { className: org.opencypher.gremlin.server.op.cypher.CypherOpProcessor }
metrics: {
  consoleReporter: {enabled: true, interval: 180000},
  csvReporter: {enabled: false, interval: 180000, fileName: /tmp/gremlin-server-metrics.csv},
  jmxReporter: {enabled: false},
  slf4jReporter: {enabled: false, interval: 180000},
  gangliaReporter: {enabled: false, interval: 180000, addressingMode: MULTICAST},
  graphiteReporter: {enabled: false, interval: 180000}}
threadPoolBoss: 1
maxInitialLineLength: 4096
maxHeaderSize: 8192
maxChunkSize: 8192
maxContentLength: 81928192
maxAccumulationBufferComponents: 1024
resultIterationBatchSize: 64
writeBufferLowWaterMark: 32768
writeBufferHighWaterMark: 81928192

As you can see, I have mentioned scriptEvaluationTimeout in the file and the processor has been added too - { className: org.opencypher.gremlin.server.op.cypher.CypherOpProcessor }

Am I missing something here?

I ran the cypher query through gremlin-console using 1.0.3 plugin and connecting to my gremlin-server remotely which uses the above gremlin-server.yaml

SarthakGhosh16 commented 4 years ago

I even tried

- { className: org.opencypher.gremlin.server.op.cypher.CypherOpProcessor, config: { scriptEvaluationTimeout: 120000 }}

but this returned an error that scriptEvaluationTimeout arg is unknown