You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by sp...@apache.org on 2016/05/06 16:29:23 UTC
incubator-tinkerpop git commit: Deprecate gremlin server's
serializedResponseTimeout
Repository: incubator-tinkerpop
Updated Branches:
refs/heads/master 8968c56b6 -> 1c6aa55ad
Deprecate gremlin server's serializedResponseTimeout
This was a pretty simple change. Basically made it possible for the setting to be disabled, then made the default for that value "disabled" and then added deprecation annotations. CTR
Project: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/commit/1c6aa55a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/tree/1c6aa55a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/diff/1c6aa55a
Branch: refs/heads/master
Commit: 1c6aa55adbc1639c0b9e8b055c1f17df19a8af03
Parents: 8968c56
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Fri May 6 12:27:44 2016 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Fri May 6 12:29:15 2016 -0400
----------------------------------------------------------------------
.../src/reference/gremlin-applications.asciidoc | 20 +++++++-------------
gremlin-server/conf/gremlin-server-classic.yaml | 1 -
gremlin-server/conf/gremlin-server-min.yaml | 1 -
.../conf/gremlin-server-modern-readonly.yaml | 1 -
gremlin-server/conf/gremlin-server-modern.yaml | 1 -
gremlin-server/conf/gremlin-server-neo4j.yaml | 1 -
.../conf/gremlin-server-rest-modern.yaml | 1 -
.../conf/gremlin-server-rest-secure.yaml | 1 -
gremlin-server/conf/gremlin-server-secure.yaml | 1 -
gremlin-server/conf/gremlin-server-spark.yaml | 1 -
gremlin-server/conf/gremlin-server.yaml | 1 -
.../tinkerpop/gremlin/server/Settings.java | 7 +++++--
.../gremlin/server/op/AbstractOpProcessor.java | 2 +-
.../server/GremlinServerIntegrateTest.java | 4 ++++
.../remote/gremlin-server-integration.yaml | 1 -
.../server/gremlin-server-integration.yaml | 1 -
.../server/gremlin-server-performance.yaml | 1 -
17 files changed, 17 insertions(+), 29 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/1c6aa55a/docs/src/reference/gremlin-applications.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/reference/gremlin-applications.asciidoc b/docs/src/reference/gremlin-applications.asciidoc
index 5bf76a6..ea79621 100644
--- a/docs/src/reference/gremlin-applications.asciidoc
+++ b/docs/src/reference/gremlin-applications.asciidoc
@@ -961,7 +961,6 @@ The following table describes the various configuration options that Gremlin Ser
|serializers |A `List` of `Map` settings, where each `Map` represents a `MessageSerializer` implementation to use along with its configuration. |_none_
|serializers[X].className |The full class name of the `MessageSerializer` implementation. |_none_
|serializers[X].config |A `Map` containing `MessageSerializer` specific configurations. |_none_
-|serializedResponseTimeout |The amount of time in milliseconds before a response serialization times out. The notion of "response serialization" refers to the time it takes for Gremlin Server to iterate an entire result after the script is evaluated in the `ScriptEngine`. |30000
|ssl.enabled |Determines if SSL is turned on or not. |false
|ssl.keyCertChainFile |The X.509 certificate chain file in PEM format. If this value is not present and `ssl.enabled` is `true` a self-signed certificate will be used (not suitable for production). |_none_
|ssl.keyFile |The `PKCS#8` private key file in PEM format. If this value is not present and `ssl.enabled` is `true` a self-signed certificate will be used (not suitable for production). |_none_
@@ -1388,20 +1387,15 @@ generally means being measured in the low hundreds of milliseconds and "slow" me
** If the bulk of the scripts being processed are expected to be "fast", then a good starting point for this setting is `2*threadPoolWorker`.
** If the bulk of the scripts being processed are expected to be "slow", then a good starting point for this setting is `4*threadPoolWorker`.
* Scripts that are "slow" can really hurt Gremlin Server if they are not properly accounted for. `ScriptEngine`
-evaluations are blocking operations that aren't easily interrupted, so once a "slow" script is being evaluated in
+evaluations are blocking operations that aren't always easily interrupted, so once a "slow" script is being evaluated in
the context of a `ScriptEngine` it must finish its work. Lots of "slow" scripts will eventually consume the
`gremlinPool` preventing other scripts from getting processed from the queue.
-** To limit the impact of this problem consider properly setting the `scriptEvaluationTimeout` and the `serializedResponseTimeout` to something "sane".
-** Test the traversals being sent to Gremlin Server and determine the maximum time they take to evaluate and iterate
-over results, then set these configurations accordingly.
-** Note that `scriptEvaluationTimeout` does not interrupt the evaluation on timeout. It merely allows Gremlin Server
-to "ignore" the result of that evaluation, which means the thread in the `gremlinPool` will still be consumed after
-the timeout.
-** The `serializedResponseTimeout` will kill the result iteration process and prevent additional processing. In most
-situations, the iteration and serialization process is the more costly step in this process as an errant script that
-returns a million or more results could send Gremlin Server into a long streaming cycle. Script evaluation on the
-other hand is usually very fast, occurring on the order of milliseconds, but that is entirely dependent on the
-contents of the script itself.
+** To limit the impact of this problem, consider properly setting the `scriptEvaluationTimeout` to something "sane".
+In other words, test the traversals being sent to Gremlin Server and determine the maximum time they take to evaluate
+and iterate over results, then set the timeout value accordingly.
+** Note that `scriptEvaluationTimeout` can only attempt to interrupt the evaluation on timeout. It allows Gremlin
+Server to "ignore" the result of that evaluation, which means the thread in the `gremlinPool` that did the evaluation
+may still be consumed after the timeout.
* Graph element serialization for `Vertex` and `Edge` can be expensive, as their data structures are complex given the
possible existence of multi-properties and meta-properties. When returning data from Gremlin Server only return the
data that is required. For example, if only two properties of a `Vertex` are needed then simply return the two rather
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/1c6aa55a/gremlin-server/conf/gremlin-server-classic.yaml
----------------------------------------------------------------------
diff --git a/gremlin-server/conf/gremlin-server-classic.yaml b/gremlin-server/conf/gremlin-server-classic.yaml
index 6ec2a37..0ac4a58 100644
--- a/gremlin-server/conf/gremlin-server-classic.yaml
+++ b/gremlin-server/conf/gremlin-server-classic.yaml
@@ -20,7 +20,6 @@ port: 8182
threadPoolWorker: 1
gremlinPool: 8
scriptEvaluationTimeout: 30000
-serializedResponseTimeout: 30000
graphs: {
graph: conf/tinkergraph-empty.properties}
plugins:
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/1c6aa55a/gremlin-server/conf/gremlin-server-min.yaml
----------------------------------------------------------------------
diff --git a/gremlin-server/conf/gremlin-server-min.yaml b/gremlin-server/conf/gremlin-server-min.yaml
index 042ee29..243c41e 100644
--- a/gremlin-server/conf/gremlin-server-min.yaml
+++ b/gremlin-server/conf/gremlin-server-min.yaml
@@ -20,7 +20,6 @@ port: 8182
threadPoolWorker: 1
gremlinPool: 8
scriptEvaluationTimeout: 30000
-serializedResponseTimeout: 30000
graphs: {
graph: conf/tinkergraph-empty.properties}
plugins:
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/1c6aa55a/gremlin-server/conf/gremlin-server-modern-readonly.yaml
----------------------------------------------------------------------
diff --git a/gremlin-server/conf/gremlin-server-modern-readonly.yaml b/gremlin-server/conf/gremlin-server-modern-readonly.yaml
index 97ce6da..cc0b0ad 100644
--- a/gremlin-server/conf/gremlin-server-modern-readonly.yaml
+++ b/gremlin-server/conf/gremlin-server-modern-readonly.yaml
@@ -20,7 +20,6 @@ port: 8182
threadPoolWorker: 1
gremlinPool: 8
scriptEvaluationTimeout: 30000
-serializedResponseTimeout: 30000
graphs: {
graph: conf/tinkergraph-empty.properties}
plugins:
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/1c6aa55a/gremlin-server/conf/gremlin-server-modern.yaml
----------------------------------------------------------------------
diff --git a/gremlin-server/conf/gremlin-server-modern.yaml b/gremlin-server/conf/gremlin-server-modern.yaml
index 5744d29..c97ae14 100644
--- a/gremlin-server/conf/gremlin-server-modern.yaml
+++ b/gremlin-server/conf/gremlin-server-modern.yaml
@@ -20,7 +20,6 @@ port: 8182
threadPoolWorker: 1
gremlinPool: 8
scriptEvaluationTimeout: 30000
-serializedResponseTimeout: 30000
graphs: {
graph: conf/tinkergraph-empty.properties}
plugins:
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/1c6aa55a/gremlin-server/conf/gremlin-server-neo4j.yaml
----------------------------------------------------------------------
diff --git a/gremlin-server/conf/gremlin-server-neo4j.yaml b/gremlin-server/conf/gremlin-server-neo4j.yaml
index e9d6cd7..d32ce8c 100644
--- a/gremlin-server/conf/gremlin-server-neo4j.yaml
+++ b/gremlin-server/conf/gremlin-server-neo4j.yaml
@@ -30,7 +30,6 @@ port: 8182
threadPoolWorker: 1
gremlinPool: 8
scriptEvaluationTimeout: 30000
-serializedResponseTimeout: 30000
channelizer: org.apache.tinkerpop.gremlin.server.channel.WebSocketChannelizer
graphs: {
graph: conf/neo4j-empty.properties}
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/1c6aa55a/gremlin-server/conf/gremlin-server-rest-modern.yaml
----------------------------------------------------------------------
diff --git a/gremlin-server/conf/gremlin-server-rest-modern.yaml b/gremlin-server/conf/gremlin-server-rest-modern.yaml
index 62ad779..dbfb1bb 100644
--- a/gremlin-server/conf/gremlin-server-rest-modern.yaml
+++ b/gremlin-server/conf/gremlin-server-rest-modern.yaml
@@ -20,7 +20,6 @@ port: 8182
threadPoolWorker: 1
gremlinPool: 8
scriptEvaluationTimeout: 30000
-serializedResponseTimeout: 30000
channelizer: org.apache.tinkerpop.gremlin.server.channel.HttpChannelizer
graphs: {
graph: conf/tinkergraph-empty.properties}
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/1c6aa55a/gremlin-server/conf/gremlin-server-rest-secure.yaml
----------------------------------------------------------------------
diff --git a/gremlin-server/conf/gremlin-server-rest-secure.yaml b/gremlin-server/conf/gremlin-server-rest-secure.yaml
index 0659f74..ff5c550 100644
--- a/gremlin-server/conf/gremlin-server-rest-secure.yaml
+++ b/gremlin-server/conf/gremlin-server-rest-secure.yaml
@@ -28,7 +28,6 @@ port: 8182
threadPoolWorker: 1
gremlinPool: 8
scriptEvaluationTimeout: 30000
-serializedResponseTimeout: 30000
channelizer: org.apache.tinkerpop.gremlin.server.channel.HttpChannelizer
graphs: {
graph: conf/tinkergraph-empty.properties}
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/1c6aa55a/gremlin-server/conf/gremlin-server-secure.yaml
----------------------------------------------------------------------
diff --git a/gremlin-server/conf/gremlin-server-secure.yaml b/gremlin-server/conf/gremlin-server-secure.yaml
index 721932b..8189fef 100644
--- a/gremlin-server/conf/gremlin-server-secure.yaml
+++ b/gremlin-server/conf/gremlin-server-secure.yaml
@@ -28,7 +28,6 @@ port: 8182
threadPoolWorker: 1
gremlinPool: 8
scriptEvaluationTimeout: 30000
-serializedResponseTimeout: 30000
channelizer: org.apache.tinkerpop.gremlin.server.channel.WebSocketChannelizer
graphs: {
graph: conf/tinkergraph-empty.properties}
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/1c6aa55a/gremlin-server/conf/gremlin-server-spark.yaml
----------------------------------------------------------------------
diff --git a/gremlin-server/conf/gremlin-server-spark.yaml b/gremlin-server/conf/gremlin-server-spark.yaml
index e6510b6..a0467fc 100644
--- a/gremlin-server/conf/gremlin-server-spark.yaml
+++ b/gremlin-server/conf/gremlin-server-spark.yaml
@@ -43,7 +43,6 @@ port: 8182
threadPoolWorker: 1
gremlinPool: 8
scriptEvaluationTimeout: 30000
-serializedResponseTimeout: 30000
channelizer: org.apache.tinkerpop.gremlin.server.channel.WebSocketChannelizer
graphs: {
graph: conf/hadoop-gryo.properties}
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/1c6aa55a/gremlin-server/conf/gremlin-server.yaml
----------------------------------------------------------------------
diff --git a/gremlin-server/conf/gremlin-server.yaml b/gremlin-server/conf/gremlin-server.yaml
index f310f56..0723553 100644
--- a/gremlin-server/conf/gremlin-server.yaml
+++ b/gremlin-server/conf/gremlin-server.yaml
@@ -20,7 +20,6 @@ port: 8182
threadPoolWorker: 1
gremlinPool: 8
scriptEvaluationTimeout: 30000
-serializedResponseTimeout: 30000
channelizer: org.apache.tinkerpop.gremlin.server.channel.WebSocketChannelizer
graphs: {
graph: conf/tinkergraph-empty.properties}
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/1c6aa55a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/Settings.java
----------------------------------------------------------------------
diff --git a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/Settings.java b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/Settings.java
index b5d69f0..112b43f 100644
--- a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/Settings.java
+++ b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/Settings.java
@@ -107,9 +107,12 @@ public class Settings {
/**
* Time in milliseconds to wait while an evaluated script serializes its results. This value represents the
- * total serialization time for the request. Defaults to 30000.
+ * total serialization time allowed for the request. Defaults to 0 which disables this setting.
+ *
+ * @deprecated As of release 3.2.1, replaced wholly by {@link #scriptEvaluationTimeout}.
*/
- public long serializedResponseTimeout = 30000L;
+ @Deprecated
+ public long serializedResponseTimeout = 0L;
/**
* Number of items in a particular resultset to iterate and serialize prior to pushing the data down the wire
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/1c6aa55a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/op/AbstractOpProcessor.java
----------------------------------------------------------------------
diff --git a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/op/AbstractOpProcessor.java b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/op/AbstractOpProcessor.java
index 7a97c94..c3bad03 100644
--- a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/op/AbstractOpProcessor.java
+++ b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/op/AbstractOpProcessor.java
@@ -166,7 +166,7 @@ public abstract class AbstractOpProcessor implements OpProcessor {
}
stopWatch.split();
- if (stopWatch.getSplitTime() > settings.serializedResponseTimeout) {
+ if (settings.serializedResponseTimeout > 0 && stopWatch.getSplitTime() > settings.serializedResponseTimeout) {
final String timeoutMsg = String.format("Serialization of the entire response exceeded the 'serializeResponseTimeout' setting %s",
warnOnce ? "[Gremlin Server paused writes to client as messages were not being consumed quickly enough]" : "");
throw new TimeoutException(timeoutMsg.trim());
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/1c6aa55a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerIntegrateTest.java
----------------------------------------------------------------------
diff --git a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerIntegrateTest.java b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerIntegrateTest.java
index 99bb745..16cbdee 100644
--- a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerIntegrateTest.java
+++ b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerIntegrateTest.java
@@ -560,8 +560,12 @@ public class GremlinServerIntegrateTest extends AbstractGremlinServerIntegration
}
}
+ /**
+ * @deprecated As of release 3.2.1, replaced by tests covering {@link Settings#scriptEvaluationTimeout}.
+ */
@Test
@SuppressWarnings("unchecked")
+ @Deprecated
public void shouldReceiveFailureTimeOutOnTotalSerialization() throws Exception {
try (SimpleClient client = new WebSocketClient()){
final List<ResponseMessage> responses = client.submit("(0..<100000)");
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/1c6aa55a/gremlin-server/src/test/resources/org/apache/tinkerpop/gremlin/driver/remote/gremlin-server-integration.yaml
----------------------------------------------------------------------
diff --git a/gremlin-server/src/test/resources/org/apache/tinkerpop/gremlin/driver/remote/gremlin-server-integration.yaml b/gremlin-server/src/test/resources/org/apache/tinkerpop/gremlin/driver/remote/gremlin-server-integration.yaml
index c8a78fb..adb0fe3 100644
--- a/gremlin-server/src/test/resources/org/apache/tinkerpop/gremlin/driver/remote/gremlin-server-integration.yaml
+++ b/gremlin-server/src/test/resources/org/apache/tinkerpop/gremlin/driver/remote/gremlin-server-integration.yaml
@@ -20,7 +20,6 @@ port: 8182
threadPoolWorker: 1
gremlinPool: 8
scriptEvaluationTimeout: 30000
-serializedResponseTimeout: 30000
graphs: {
graph: conf/tinkergraph-empty.properties,
classic: conf/tinkergraph-empty.properties,
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/1c6aa55a/gremlin-server/src/test/resources/org/apache/tinkerpop/gremlin/server/gremlin-server-integration.yaml
----------------------------------------------------------------------
diff --git a/gremlin-server/src/test/resources/org/apache/tinkerpop/gremlin/server/gremlin-server-integration.yaml b/gremlin-server/src/test/resources/org/apache/tinkerpop/gremlin/server/gremlin-server-integration.yaml
index 054f0dd..fe674aa 100644
--- a/gremlin-server/src/test/resources/org/apache/tinkerpop/gremlin/server/gremlin-server-integration.yaml
+++ b/gremlin-server/src/test/resources/org/apache/tinkerpop/gremlin/server/gremlin-server-integration.yaml
@@ -20,7 +20,6 @@ port: 8182
threadPoolWorker: 1
gremlinPool: 8
scriptEvaluationTimeout: 30000
-serializedResponseTimeout: 30000
graphs: {
graph: conf/tinkergraph-empty.properties}
plugins:
http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/1c6aa55a/gremlin-server/src/test/resources/org/apache/tinkerpop/gremlin/server/gremlin-server-performance.yaml
----------------------------------------------------------------------
diff --git a/gremlin-server/src/test/resources/org/apache/tinkerpop/gremlin/server/gremlin-server-performance.yaml b/gremlin-server/src/test/resources/org/apache/tinkerpop/gremlin/server/gremlin-server-performance.yaml
index 841523c..bdd89ed 100644
--- a/gremlin-server/src/test/resources/org/apache/tinkerpop/gremlin/server/gremlin-server-performance.yaml
+++ b/gremlin-server/src/test/resources/org/apache/tinkerpop/gremlin/server/gremlin-server-performance.yaml
@@ -20,7 +20,6 @@ port: 8182
threadPoolWorker: 1
gremlinPool: 8
scriptEvaluationTimeout: 30000
-serializedResponseTimeout: 30000
graphs: {
graph: conf/tinkergraph-empty.properties}
plugins: