tinkerpop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From spmalle...@apache.org
Subject [4/9] tinkerpop git commit: TINKERPOP-1726 Added logging output for new settings
Date Fri, 23 Feb 2018 12:42:00 GMT
TINKERPOP-1726 Added logging output for new settings

This will help explain any confusion if users decide to set millisecond values under 1000
and end up with a zero value for the config option.


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/00e4235c
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/00e4235c
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/00e4235c

Branch: refs/heads/master
Commit: 00e4235c4abbb6b34702abdfb14b63a02398d9b6
Parents: a4bf937
Author: Stephen Mallette <spmva@genoprime.com>
Authored: Tue Feb 20 09:26:03 2018 -0500
Committer: Stephen Mallette <spmva@genoprime.com>
Committed: Tue Feb 20 09:26:03 2018 -0500

----------------------------------------------------------------------
 docs/src/reference/gremlin-applications.asciidoc         |  4 ++--
 gremlin-server/conf/gremlin-server-classic.yaml          |  4 ++--
 gremlin-server/conf/gremlin-server-modern-py.yaml        |  4 ++--
 gremlin-server/conf/gremlin-server-modern-readonly.yaml  |  4 ++--
 gremlin-server/conf/gremlin-server-modern.yaml           |  4 ++--
 gremlin-server/conf/gremlin-server-neo4j.yaml            |  4 ++--
 gremlin-server/conf/gremlin-server-secure.yaml           |  4 ++--
 gremlin-server/conf/gremlin-server-spark.yaml            |  4 ++--
 gremlin-server/conf/gremlin-server.yaml                  |  4 ++--
 .../tinkerpop/gremlin/server/AbstractChannelizer.java    |  7 +++++--
 .../apache/tinkerpop/gremlin/server/GremlinServer.java   | 11 ++++++++++-
 .../org/apache/tinkerpop/gremlin/server/Settings.java    |  8 +++++---
 .../driver/remote/gremlin-server-integration.yaml        |  4 ++--
 .../gremlin/server/gremlin-server-integration.yaml       |  4 ++--
 .../gremlin/server/gremlin-server-performance.yaml       |  4 ++--
 15 files changed, 44 insertions(+), 30 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/00e4235c/docs/src/reference/gremlin-applications.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/reference/gremlin-applications.asciidoc b/docs/src/reference/gremlin-applications.asciidoc
index e84961c..5443ee2 100644
--- a/docs/src/reference/gremlin-applications.asciidoc
+++ b/docs/src/reference/gremlin-applications.asciidoc
@@ -1073,8 +1073,8 @@ The following table describes the various configuration options that
Gremlin Ser
 |graphs |A `Map` of `Graph` configuration files where the key of the `Map` becomes the name
to which the `Graph` will be bound and the value is the file name of a `Graph` configuration
file. |_none_
 |gremlinPool |The number of "Gremlin" threads available to execute actual scripts in a `ScriptEngine`.
This pool represents the workers available to handle blocking operations in Gremlin Server.
When set to `0`, Gremlin Server will use the value provided by `Runtime.availableProcessors()`.
|0
 |host |The name of the host to bind the server to. |localhost
-|idleConnectionTimeout |Time in milliseconds that the server will allow a channel to not
receive requests from a client before it automatically closes. If enabled, the value provided
should typically exceed the amount of time given to `idleWriteLimit`. Set this value to `0`
to disable this feature. |0
-|keepAliveInterval |Time in milliseconds that the server will allow a channel to not send
responses to a client before it sends a "ping" to see if it is still present. If it is present,
the client should respond with a "pong" which will thus reset the `#idleConnectionTimeout`
and keep the channel open. If enabled, this number should be smaller than the value provided
to the `idleConnectionTimeout`. Set this value to `0` to disable this feature. |0
+|idleConnectionTimeout |Time in milliseconds that the server will allow a channel to not
receive requests from a client before it automatically closes. If enabled, the value provided
should typically exceed the amount of time given to `keepAliveInterval`. Note that while this
value is to be provided as milliseconds it will resolve to second precision. Set this value
to `0` to disable this feature. |0
+|keepAliveInterval |Time in milliseconds that the server will allow a channel to not send
responses to a client before it sends a "ping" to see if it is still present. If it is present,
the client should respond with a "pong" which will thus reset the `#idleConnectionTimeout`
and keep the channel open. If enabled, this number should be smaller than the value provided
to the `idleConnectionTimeout`. Note that while this value is to be provided as milliseconds
it will resolve to second precision. Set this value to `0` to disable this feature. |0
 |maxAccumulationBufferComponents |Maximum number of request components that can be aggregated
for a message. |1024
 |maxChunkSize |The maximum length of the content or each chunk.  If the content length exceeds
this value, the transfer encoding of the decoded request will be converted to 'chunked' and
the content will be split into multiple `HttpContent` objects.  If the transfer encoding of
the HTTP request is 'chunked' already, each chunk will be split into smaller chunks if the
length of the chunk exceeds this value. |8192
 |maxContentLength |The maximum length of the aggregated content for a message.  Works in
concert with `maxChunkSize` where chunked requests are accumulated back into a single message.
 A request exceeding this size will return a `413 - Request Entity Too Large` status code.
 A response exceeding this size will raise an internal exception. |65536

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/00e4235c/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 6a7f3f4..29a3743 100644
--- a/gremlin-server/conf/gremlin-server-classic.yaml
+++ b/gremlin-server/conf/gremlin-server-classic.yaml
@@ -36,8 +36,8 @@ serializers:
 metrics: {
   slf4jReporter: {enabled: true, interval: 180000}}
 strictTransactionManagement: false
-idleReadLimit: 0
-idleWriteLimit: 0
+idleConnectionTimeout: 0
+keepAliveInterval: 0
 maxInitialLineLength: 4096
 maxHeaderSize: 8192
 maxChunkSize: 8192

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/00e4235c/gremlin-server/conf/gremlin-server-modern-py.yaml
----------------------------------------------------------------------
diff --git a/gremlin-server/conf/gremlin-server-modern-py.yaml b/gremlin-server/conf/gremlin-server-modern-py.yaml
index 726890d..aad52f8 100644
--- a/gremlin-server/conf/gremlin-server-modern-py.yaml
+++ b/gremlin-server/conf/gremlin-server-modern-py.yaml
@@ -51,8 +51,8 @@ serializers:
 metrics: {
   slf4jReporter: {enabled: true, interval: 180000}}
 strictTransactionManagement: false
-idleReadLimit: 0
-idleWriteLimit: 0
+idleConnectionTimeout: 0
+keepAliveInterval: 0
 threadPoolBoss: 1
 maxInitialLineLength: 4096
 maxHeaderSize: 8192

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/00e4235c/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 6840e18..08ae3c0 100644
--- a/gremlin-server/conf/gremlin-server-modern-readonly.yaml
+++ b/gremlin-server/conf/gremlin-server-modern-readonly.yaml
@@ -36,8 +36,8 @@ serializers:
 metrics: {
   slf4jReporter: {enabled: true, interval: 180000}}
 strictTransactionManagement: false
-idleReadLimit: 0
-idleWriteLimit: 0
+idleConnectionTimeout: 0
+keepAliveInterval: 0
 maxInitialLineLength: 4096
 maxHeaderSize: 8192
 maxChunkSize: 8192

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/00e4235c/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 6ec3e23..ac690b1 100644
--- a/gremlin-server/conf/gremlin-server-modern.yaml
+++ b/gremlin-server/conf/gremlin-server-modern.yaml
@@ -36,8 +36,8 @@ serializers:
 metrics: {
   slf4jReporter: {enabled: true, interval: 180000}}
 strictTransactionManagement: false
-idleReadLimit: 0
-idleWriteLimit: 0
+idleConnectionTimeout: 0
+keepAliveInterval: 0
 maxInitialLineLength: 4096
 maxHeaderSize: 8192
 maxChunkSize: 8192

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/00e4235c/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 a1a32ca..f88001c 100644
--- a/gremlin-server/conf/gremlin-server-neo4j.yaml
+++ b/gremlin-server/conf/gremlin-server-neo4j.yaml
@@ -55,8 +55,8 @@ metrics: {
   gangliaReporter: {enabled: false, interval: 180000, addressingMode: MULTICAST},
   graphiteReporter: {enabled: false, interval: 180000}}
 strictTransactionManagement: false
-idleReadLimit: 0
-idleWriteLimit: 0
+idleConnectionTimeout: 0
+keepAliveInterval: 0
 maxInitialLineLength: 4096
 maxHeaderSize: 8192
 maxChunkSize: 8192

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/00e4235c/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 771f31b..42a7785 100644
--- a/gremlin-server/conf/gremlin-server-secure.yaml
+++ b/gremlin-server/conf/gremlin-server-secure.yaml
@@ -58,8 +58,8 @@ metrics: {
   gangliaReporter: {enabled: false, interval: 180000, addressingMode: MULTICAST},
   graphiteReporter: {enabled: false, interval: 180000}}
 strictTransactionManagement: false
-idleReadLimit: 0
-idleWriteLimit: 0
+idleConnectionTimeout: 0
+keepAliveInterval: 0
 maxInitialLineLength: 4096
 maxHeaderSize: 8192
 maxChunkSize: 8192

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/00e4235c/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 747845a..bf7d32b 100644
--- a/gremlin-server/conf/gremlin-server-spark.yaml
+++ b/gremlin-server/conf/gremlin-server-spark.yaml
@@ -68,8 +68,8 @@ metrics: {
   gangliaReporter: {enabled: false, interval: 180000, addressingMode: MULTICAST},
   graphiteReporter: {enabled: false, interval: 180000}}
 strictTransactionManagement: false
-idleReadLimit: 0
-idleWriteLimit: 0
+idleConnectionTimeout: 0
+keepAliveInterval: 0
 maxInitialLineLength: 4096
 maxHeaderSize: 8192
 maxChunkSize: 8192

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/00e4235c/gremlin-server/conf/gremlin-server.yaml
----------------------------------------------------------------------
diff --git a/gremlin-server/conf/gremlin-server.yaml b/gremlin-server/conf/gremlin-server.yaml
index 6b61d4b..050d9d8 100644
--- a/gremlin-server/conf/gremlin-server.yaml
+++ b/gremlin-server/conf/gremlin-server.yaml
@@ -45,8 +45,8 @@ metrics: {
   gangliaReporter: {enabled: false, interval: 180000, addressingMode: MULTICAST},
   graphiteReporter: {enabled: false, interval: 180000}}
 strictTransactionManagement: false
-idleReadLimit: 0
-idleWriteLimit: 0
+idleConnectionTimeout: 0
+keepAliveInterval: 0
 maxInitialLineLength: 4096
 maxHeaderSize: 8192
 maxChunkSize: 8192

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/00e4235c/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/AbstractChannelizer.java
----------------------------------------------------------------------
diff --git a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/AbstractChannelizer.java
b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/AbstractChannelizer.java
index bfb9660..edea752 100644
--- a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/AbstractChannelizer.java
+++ b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/AbstractChannelizer.java
@@ -153,8 +153,11 @@ public abstract class AbstractChannelizer extends ChannelInitializer<SocketChann
 
         // checks for no activity on a channel and triggers an event that is consumed by
the OpSelectorHandler
         // and either closes the connection or sends a ping to see if the client is still
alive
-        if (supportsIdleMonitor())
-            pipeline.addLast(new IdleStateHandler((int) (settings.idleConnectionTimeout /
1000), (int) (settings.keepAliveInterval / 1000),0));
+        if (supportsIdleMonitor()) {
+            final int idleConnectionTimeout = (int) (settings.idleConnectionTimeout / 1000);
+            final int keepAliveInterval = (int) (settings.keepAliveInterval / 1000);
+            pipeline.addLast(new IdleStateHandler(idleConnectionTimeout, keepAliveInterval,
0));
+        }
 
         // the implementation provides the method by which Gremlin Server will process requests.
 the end of the
         // pipeline must decode to an incoming RequestMessage instances and encode to a outgoing
ResponseMessage

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/00e4235c/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/GremlinServer.java
----------------------------------------------------------------------
diff --git a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/GremlinServer.java
b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/GremlinServer.java
index 3c7b861..7aefbe6 100644
--- a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/GremlinServer.java
+++ b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/GremlinServer.java
@@ -216,7 +216,16 @@ public class GremlinServer {
         try {
             final Class clazz = Class.forName(settings.channelizer);
             final Object o = clazz.newInstance();
-            return (Channelizer) o;
+
+            final Channelizer c = (Channelizer) o;
+            if (c.supportsIdleMonitor()) {
+                logger.info("idleConnectionTimeout was set to {} which resolves to {} seconds
when configuring this value - this feature will be {}",
+                        settings.idleConnectionTimeout, settings.idleConnectionTimeout /
1000, settings.idleConnectionTimeout < 1000 ? "disabled" : "enabled");
+                logger.info("keepAliveInterval was set to {} which resolves to {} seconds
when configuring this value - this feature will be {}",
+                        settings.keepAliveInterval, settings.keepAliveInterval / 1000, settings.keepAliveInterval
< 1000 ? "disabled" : "enabled");
+            }
+
+            return c;
         } catch (ClassNotFoundException cnfe) {
             logger.error("Could not find {} implementation defined by the 'channelizer' setting
as: {}",
                     Channelizer.class.getName(), settings.channelizer);

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/00e4235c/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 ec2eaf9..74a5a1a 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
@@ -166,15 +166,17 @@ public class Settings {
     /**
      * Time in milliseconds that the server will allow a channel to not receive requests
from a client before it
      * automatically closes. If enabled, the value provided should typically exceed the amount
of time given to
-     * {@link #keepAliveInterval}. Set this value to 0 to disable this feature.
+     * {@link #keepAliveInterval}. Note that while this value is to be provided as milliseconds
it will resolve to
+     * second precision. Set this value to 0 to disable this feature.
      */
     public long idleConnectionTimeout = 0;
 
     /**
      * Time in milliseconds that the server will allow a channel to not send responses to
a client before it sends
      * a "ping" to see if it is still present. If it is present, the client should respond
with a "pong" which will
-     * thus reset the {@link #idleConnectionTimeout} and keep the channel open. If enabled,
this number should be smaller than
-     * the value provided to the {@link #idleConnectionTimeout}. Set this value to 0 to disable
this feature.
+     * thus reset the {@link #idleConnectionTimeout} and keep the channel open. If enabled,
this number should be
+     * smaller than the value provided to the {@link #idleConnectionTimeout}. Note that while
this value is to be
+     * provided as milliseconds it will resolve to second precision. Set this value to 0
to disable this feature.
      */
     public long keepAliveInterval = 0;
 

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/00e4235c/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 e08973f..7b388aa 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
@@ -44,8 +44,8 @@ processors:
 metrics: {
   slf4jReporter: {enabled: true, interval: 180000}}
 strictTransactionManagement: false
-idleReadLimit: 0
-idleWriteLimit: 0
+idleConnectionTimeout: 0
+keepAliveInterval: 0
 maxInitialLineLength: 4096
 maxHeaderSize: 8192
 maxChunkSize: 8192

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/00e4235c/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 b03e057..3b28020 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
@@ -39,8 +39,8 @@ processors:
 metrics: {
   slf4jReporter: {enabled: true, interval: 180000}}
 strictTransactionManagement: false
-idleReadLimit: 0
-idleWriteLimit: 0
+idleConnectionTimeout: 0
+keepAliveInterval: 0
 maxInitialLineLength: 4096
 maxHeaderSize: 8192
 maxChunkSize: 8192

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/00e4235c/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 a88b5a7..8ee9c79 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
@@ -36,8 +36,8 @@ processors:
 metrics: {
   slf4jReporter: {enabled: true, interval: 180000}}
 strictTransactionManagement: false
-idleReadLimit: 0
-idleWriteLimit: 0
+idleConnectionTimeout: 0
+keepAliveInterval: 0
 maxInitialLineLength: 4096
 maxHeaderSize: 8192
 maxChunkSize: 8192


Mime
View raw message