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 2018/02/23 12:42:09 UTC

[1/8] tinkerpop git commit: TINKERPOP-1726 Added idleReadLimit and idleWriteLimit for Gremlin Server

Repository: tinkerpop
Updated Branches:
  refs/heads/tp32 3df6c5806 -> d97056443


TINKERPOP-1726 Added idleReadLimit and idleWriteLimit for Gremlin Server

This enables Gremlin Server to periodically ping clients and auto-close zombie connections when a client disappears without issuing a close.


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

Branch: refs/heads/tp32
Commit: 10ab33410862ccb935e911b028c27f4cd835b70f
Parents: bcffaad
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Fri Feb 16 16:19:56 2018 -0500
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Sat Feb 17 06:50:46 2018 -0500

----------------------------------------------------------------------
 CHANGELOG.asciidoc                              |  1 +
 .../src/reference/gremlin-applications.asciidoc | 13 ++++---
 .../upgrade/release-3.2.x-incubating.asciidoc   | 15 ++++++++
 .../driver/handler/WebSocketClientHandler.java  |  5 ++-
 gremlin-server/conf/gremlin-server-classic.yaml |  2 ++
 .../conf/gremlin-server-modern-py.yaml          |  2 ++
 .../conf/gremlin-server-modern-readonly.yaml    |  2 ++
 gremlin-server/conf/gremlin-server-modern.yaml  |  2 ++
 gremlin-server/conf/gremlin-server-neo4j.yaml   |  2 ++
 gremlin-server/conf/gremlin-server-secure.yaml  |  2 ++
 gremlin-server/conf/gremlin-server-spark.yaml   |  2 ++
 gremlin-server/conf/gremlin-server.yaml         |  2 ++
 .../gremlin/server/AbstractChannelizer.java     | 11 ++++--
 .../tinkerpop/gremlin/server/Channelizer.java   | 17 +++++++++
 .../tinkerpop/gremlin/server/Settings.java      | 16 ++++++++-
 .../server/channel/WebSocketChannelizer.java    | 11 ++++++
 .../server/channel/WsAndHttpChannelizer.java    | 28 +++++++--------
 .../server/handler/OpSelectorHandler.java       | 35 +++++++++++++++++++
 .../handler/WsAndHttpChannelizerHandler.java    | 11 ++++--
 .../server/GremlinServerIntegrateTest.java      | 36 +++++++++++++++++++-
 .../gremlin/util/Log4jRecordingAppender.java    |  5 +--
 .../util/Log4jRecordingAppenderTest.java        |  2 +-
 .../remote/gremlin-server-integration.yaml      |  2 ++
 .../server/gremlin-server-integration.yaml      |  2 ++
 .../server/gremlin-server-performance.yaml      |  2 ++
 25 files changed, 198 insertions(+), 30 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/10ab3341/CHANGELOG.asciidoc
----------------------------------------------------------------------
diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc
index f1519b6..f516f7b 100644
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@ -25,6 +25,7 @@ image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/ima
 
 * Modified `GremlinDslProcessor` so that it generated the `getAnonymousTraversalClass()` method to return the DSL version of `__`.
 * Added the "Kitchen Sink" test data set.
+* Added `idleReadLimit` and `idleWriteLimit` to Gremlin Server that enables a "ping" and auto-close for seemingly dead clients.
 * Fixed a bug in `NumberHelper` that led to wrong min/max results if numbers exceeded the Integer limits.
 * Delayed setting of the request identifier until `RequestMessage` construction by the builder.
 * Improved error messaging for failed serialization and deserialization of request/response messages.

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/10ab3341/docs/src/reference/gremlin-applications.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/reference/gremlin-applications.asciidoc b/docs/src/reference/gremlin-applications.asciidoc
index 4e4f190..2413bdb 100644
--- a/docs/src/reference/gremlin-applications.asciidoc
+++ b/docs/src/reference/gremlin-applications.asciidoc
@@ -1073,7 +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
-|useEpollEventLoop |try to use epoll event loops (works only on Linux os) instead of netty NIO. |false
+|idleReadLimit |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
+|idleWriteLimit |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 #idleReadLimit} and keep the channel open. If enabled, this number should be smaller than the value provided to the `idleReadLimit`. 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
@@ -1121,6 +1122,7 @@ The following table describes the various configuration options that Gremlin Ser
 |strictTransactionManagement |Set to `true` to require `aliases` to be submitted on every requests, where the `aliases` become the scope of transaction management. |false
 |threadPoolBoss |The number of threads available to Gremlin Server for accepting connections. Should always be set to `1`. |1
 |threadPoolWorker |The number of threads available to Gremlin Server for processing non-blocking reads and writes. |1
+|useEpollEventLoop |try to use epoll event loops (works only on Linux os) instead of netty NIO. |false
 |writeBufferHighWaterMark | If the number of bytes in the network send buffer exceeds this value then the channel is no longer writeable, accepting no additional writes until buffer is drained and the `writeBufferLowWaterMark` is met. |65536
 |writeBufferLowWaterMark | Once the number of bytes queued in the network send buffer exceeds the `writeBufferHighWaterMark`, the channel will not become writeable again until the buffer is drained and it drops below this value. |65536
 |=========================================================
@@ -1160,8 +1162,7 @@ The `SessionOpProcessor` provides a way to interact with Gremlin Server over a <
 |sessionTimeout |Time in milliseconds before a session will time out. |28800000
 |=========================================================
 
-StandardOpProcessor
-++++++++++++++++++
+===== StandardOpProcessor
 
 The `StandardOpProcessor` provides a way to interact with Gremlin Server without use of sessions and is the default
 method for processing script evaluation requests.
@@ -1593,8 +1594,10 @@ The following sections define best practices for working with Gremlin Server.
 
 image:gremlin-handdrawn.png[width=120,float=right] Tuning Gremlin Server for a particular environment may require some simple trial-and-error, but the following represent some basic guidelines that might be useful:
 
-* Gremlin Server defaults to a very modest maximum heap size.  Consider increasing this value for non-trivial uses.  Maximum heap size (`-Xmx`) is defined with the `JAVA_OPTIONS` setting in `gremlin-server.sh`.
-* When configuring the size of `threadPoolWorker` start with the default of `1` and increment by one as needed to a maximum of `2*number of cores`.
+* Gremlin Server defaults to a very modest maximum heap size.  Consider increasing this value for non-trivial uses.
+Maximum heap size (`-Xmx`) is defined with the `JAVA_OPTIONS` setting in `gremlin-server.sh`.
+* When configuring the size of `threadPoolWorker` start with the default of `1` and increment by one as needed to a
+maximum of `2*number of cores`.
 * The "right" size of the `gremlinPool` setting is somewhat dependent on the type of scripts that will be processed
 by Gremlin Server.  As requests arrive to Gremlin Server they are decoded and queued to be processed by threads in
 this pool.  When this pool is exhausted of threads, Gremlin Server will continue to accept incoming requests, but

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/10ab3341/docs/src/upgrade/release-3.2.x-incubating.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/upgrade/release-3.2.x-incubating.asciidoc b/docs/src/upgrade/release-3.2.x-incubating.asciidoc
index 00a6e83..f623127 100644
--- a/docs/src/upgrade/release-3.2.x-incubating.asciidoc
+++ b/docs/src/upgrade/release-3.2.x-incubating.asciidoc
@@ -27,6 +27,21 @@ image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/ima
 
 Please see the link:https://github.com/apache/tinkerpop/blob/3.2.8/CHANGELOG.asciidoc#release-3-2-8[changelog] for a complete list of all the modifications that are part of this release.
 
+=== Upgrading for Users
+
+==== Improved Connection Monitoring
+
+Gremlin Server now has two new settings: `idleReadLimit` and `idleWriteLimit`. The `idleWriteLimit` tells Gremlin
+Server how long it should wait between writes to a client before it issues a "ping" to that client to see if it is
+still present. The `idleReadLimit` represents how long Gremlin Server should wait between requests from a client before
+it closes the connection on the server side. By default, these two configurations are set to zero, meaning that they
+are both disabled.
+
+This change should help to alleviate issues where connections are left open on the server longer than they should be
+by clients that might mysteriously disappear without properly closing their connections.
+
+See: link:https://issues.apache.org/jira/browse/TINKERPOP-1726[TINKERPOP-1726]
+
 === Upgrading for Providers
 
 ==== Graph System Providers

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/10ab3341/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/handler/WebSocketClientHandler.java
----------------------------------------------------------------------
diff --git a/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/handler/WebSocketClientHandler.java b/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/handler/WebSocketClientHandler.java
index c63d790..0a1f2f7 100644
--- a/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/handler/WebSocketClientHandler.java
+++ b/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/handler/WebSocketClientHandler.java
@@ -26,6 +26,7 @@ import io.netty.channel.SimpleChannelInboundHandler;
 import io.netty.handler.codec.http.FullHttpResponse;
 import io.netty.handler.codec.http.websocketx.BinaryWebSocketFrame;
 import io.netty.handler.codec.http.websocketx.CloseWebSocketFrame;
+import io.netty.handler.codec.http.websocketx.PingWebSocketFrame;
 import io.netty.handler.codec.http.websocketx.PongWebSocketFrame;
 import io.netty.handler.codec.http.websocketx.TextWebSocketFrame;
 import io.netty.handler.codec.http.websocketx.WebSocketClientHandshaker;
@@ -85,7 +86,9 @@ public final class WebSocketClientHandler extends SimpleChannelInboundHandler<Ob
         final WebSocketFrame frame = (WebSocketFrame) msg;
         if (frame instanceof TextWebSocketFrame) {
             ctx.fireChannelRead(frame.retain(2));
-        } else if (frame instanceof PongWebSocketFrame) {
+        } else if (frame instanceof PingWebSocketFrame) {
+            ctx.writeAndFlush(new PongWebSocketFrame());
+        }else if (frame instanceof PongWebSocketFrame) {
             logger.debug("Received response from keep-alive request");
         } else if (frame instanceof BinaryWebSocketFrame) {
             ctx.fireChannelRead(frame.retain(2));

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

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/10ab3341/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 a04681f..726890d 100644
--- a/gremlin-server/conf/gremlin-server-modern-py.yaml
+++ b/gremlin-server/conf/gremlin-server-modern-py.yaml
@@ -51,6 +51,8 @@ serializers:
 metrics: {
   slf4jReporter: {enabled: true, interval: 180000}}
 strictTransactionManagement: false
+idleReadLimit: 0
+idleWriteLimit: 0
 threadPoolBoss: 1
 maxInitialLineLength: 4096
 maxHeaderSize: 8192

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

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

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

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

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

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

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/10ab3341/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 c4d8398..0bc4e00 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
@@ -23,6 +23,7 @@ import io.netty.handler.ssl.SslContext;
 import io.netty.handler.ssl.SslContextBuilder;
 import io.netty.handler.ssl.SslProvider;
 import io.netty.handler.ssl.util.SelfSignedCertificate;
+import io.netty.handler.timeout.IdleStateHandler;
 import org.apache.tinkerpop.gremlin.driver.MessageSerializer;
 import org.apache.tinkerpop.gremlin.driver.ser.AbstractGryoMessageSerializerV1d0;
 import org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV1d0;
@@ -98,6 +99,7 @@ public abstract class AbstractChannelizer extends ChannelInitializer<SocketChann
 
     protected final Map<String, MessageSerializer> serializers = new HashMap<>();
 
+    private IdleStateHandler idleStateHandler;
     private OpSelectorHandler opSelectorHandler;
     private OpExecutorHandler opExecutorHandler;
     private IteratorHandler iteratorHandler;
@@ -138,7 +140,7 @@ public abstract class AbstractChannelizer extends ChannelInitializer<SocketChann
         authenticator = createAuthenticator(settings.authentication);
 
         // these handlers don't share any state and can thus be initialized once per pipeline
-        opSelectorHandler = new OpSelectorHandler(settings, graphManager, gremlinExecutor, scheduledExecutorService);
+        opSelectorHandler = new OpSelectorHandler(settings, graphManager, gremlinExecutor, scheduledExecutorService, this);
         opExecutorHandler = new OpExecutorHandler(settings, graphManager, gremlinExecutor, scheduledExecutorService);
         iteratorHandler = new IteratorHandler(settings);
     }
@@ -147,7 +149,12 @@ public abstract class AbstractChannelizer extends ChannelInitializer<SocketChann
     public void initChannel(final SocketChannel ch) throws Exception {
         final ChannelPipeline pipeline = ch.pipeline();
 
-        if (sslContext.isPresent()) pipeline.addLast(PIPELINE_SSL, sslContext.get().newHandler(ch.alloc()));
+        sslContext.ifPresent(sslContext -> pipeline.addLast(PIPELINE_SSL, sslContext.newHandler(ch.alloc())));
+
+        // 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.idleReadLimit / 1000), (int) (settings.idleWriteLimit / 1000),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/10ab3341/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/Channelizer.java
----------------------------------------------------------------------
diff --git a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/Channelizer.java b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/Channelizer.java
index fd7821e..15fb7d3 100644
--- a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/Channelizer.java
+++ b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/Channelizer.java
@@ -36,4 +36,21 @@ public interface Channelizer extends ChannelHandler {
      * This method is called just after the {@code Channelizer} is initialized.
      */
     public void init(final ServerGremlinExecutor<EventLoopGroup> serverGremlinExecutor);
+
+    /**
+     * Create a message to send to seemingly dead clients to see if they respond back. The message sent will be
+     * dependent on the implementation. For example, a websocket implementation would create a "ping" message.
+     * This method will only be used if {@link #supportsIdleMonitor()} is {@code true}.
+     */
+    public default Object createIdleDetectionMessage() {
+        return null;
+    }
+
+    /**
+     * Determines if the channelizer supports a method for keeping the connection alive and auto-closing zombie
+     * channels.
+     */
+    public default boolean supportsIdleMonitor() {
+        return false;
+    }
 }

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/10ab3341/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 d0bd8fd..75466ca 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
@@ -31,7 +31,6 @@ import org.apache.tinkerpop.gremlin.server.channel.WebSocketChannelizer;
 import org.apache.tinkerpop.gremlin.server.handler.AbstractAuthenticationHandler;
 import org.apache.tinkerpop.gremlin.server.util.DefaultGraphManager;
 import info.ganglia.gmetric4j.gmetric.GMetric;
-import org.apache.tinkerpop.gremlin.server.op.session.SessionOpProcessor;
 import org.apache.tinkerpop.gremlin.server.util.LifeCycleHook;
 import org.apache.tinkerpop.gremlin.structure.Graph;
 import org.yaml.snakeyaml.TypeDescription;
@@ -165,6 +164,21 @@ public class Settings {
     public int writeBufferLowWaterMark = 1024 * 32;
 
     /**
+     * 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 #idleWriteLimit}. Set this value to 0 to disable this feature.
+     */
+    public long idleReadLimit = 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 #idleReadLimit} and keep the channel open. If enabled, this number should be smaller than
+     * the value provided to the {@link #idleReadLimit}. Set this value to 0 to disable this feature.
+     */
+    public long idleWriteLimit = 0;
+
+    /**
      * If set to {@code true} the {@code aliases} option is required on requests and Gremlin Server will use that
      * information to control which {@link Graph} instances are transaction managed for that request.  If this
      * setting is false (which is the default), specification of {@code aliases} is not required and Gremlin

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/10ab3341/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/channel/WebSocketChannelizer.java
----------------------------------------------------------------------
diff --git a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/channel/WebSocketChannelizer.java b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/channel/WebSocketChannelizer.java
index af41cc6..a6ec20b 100644
--- a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/channel/WebSocketChannelizer.java
+++ b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/channel/WebSocketChannelizer.java
@@ -19,6 +19,7 @@
 package org.apache.tinkerpop.gremlin.server.channel;
 
 import io.netty.channel.EventLoopGroup;
+import io.netty.handler.codec.http.websocketx.PingWebSocketFrame;
 import org.apache.tinkerpop.gremlin.server.AbstractChannelizer;
 import org.apache.tinkerpop.gremlin.server.auth.AllowAllAuthenticator;
 import org.apache.tinkerpop.gremlin.server.handler.AbstractAuthenticationHandler;
@@ -113,6 +114,16 @@ public class WebSocketChannelizer extends AbstractChannelizer {
             pipeline.addLast(PIPELINE_AUTHENTICATOR, authenticationHandler);
     }
 
+    @Override
+    public boolean supportsIdleMonitor() {
+        return true;
+    }
+
+    @Override
+    public Object createIdleDetectionMessage() {
+        return new PingWebSocketFrame();
+    }
+
     private AbstractAuthenticationHandler instantiateAuthenticationHandler(final Settings.AuthenticationSettings authSettings) {
         final String authenticationHandler = authSettings.authenticationHandler;
         if (authenticationHandler == null) {

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/10ab3341/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/channel/WsAndHttpChannelizer.java
----------------------------------------------------------------------
diff --git a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/channel/WsAndHttpChannelizer.java b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/channel/WsAndHttpChannelizer.java
index 58885fb..e415887 100644
--- a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/channel/WsAndHttpChannelizer.java
+++ b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/channel/WsAndHttpChannelizer.java
@@ -18,32 +18,20 @@
  */
 package org.apache.tinkerpop.gremlin.server.channel;
 
-import io.netty.channel.ChannelInboundHandlerAdapter;
 import io.netty.channel.ChannelPipeline;
 import io.netty.channel.EventLoopGroup;
-import io.netty.handler.codec.http.HttpObjectAggregator;
-import io.netty.handler.codec.http.HttpRequestDecoder;
-import io.netty.handler.codec.http.HttpResponseEncoder;
-import io.netty.handler.codec.http.websocketx.WebSocketServerProtocolHandler;
-import io.netty.handler.logging.LogLevel;
-import io.netty.handler.logging.LoggingHandler;
 import org.apache.tinkerpop.gremlin.server.AbstractChannelizer;
 import org.apache.tinkerpop.gremlin.server.handler.HttpGremlinEndpointHandler;
 import org.apache.tinkerpop.gremlin.server.handler.WsAndHttpChannelizerHandler;
 import org.apache.tinkerpop.gremlin.server.util.ServerGremlinExecutor;
-import org.apache.tinkerpop.gremlin.server.channel.WebSocketChannelizer;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 /**
- *A channelizer for port unification with websockets and http
- *@author Keith Lohnes lohnesk@gmail.com
+ * A channelizer for port unification with websockets and http
+ *
+ * @author Keith Lohnes lohnesk@gmail.com
  */
-
 public class WsAndHttpChannelizer extends AbstractChannelizer {
 
-    private static final Logger logger = LoggerFactory.getLogger(WsAndHttpChannelizer.class);
-
     private WsAndHttpChannelizerHandler handler;
 
     @Override
@@ -58,4 +46,14 @@ public class WsAndHttpChannelizer extends AbstractChannelizer {
         handler.configure(pipeline);
         pipeline.addAfter(PIPELINE_HTTP_REQUEST_DECODER, "WsAndHttpChannelizerHandler", handler);
     }
+
+    @Override
+    public boolean supportsIdleMonitor() {
+        return handler.getWsChannelizer().supportsIdleMonitor();
+    }
+
+    @Override
+    public Object createIdleDetectionMessage() {
+        return handler.getWsChannelizer().createIdleDetectionMessage();
+    }
 }

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/10ab3341/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/handler/OpSelectorHandler.java
----------------------------------------------------------------------
diff --git a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/handler/OpSelectorHandler.java b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/handler/OpSelectorHandler.java
index 30055bf..8bb9c44 100644
--- a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/handler/OpSelectorHandler.java
+++ b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/handler/OpSelectorHandler.java
@@ -19,10 +19,13 @@
 package org.apache.tinkerpop.gremlin.server.handler;
 
 import com.codahale.metrics.Meter;
+import io.netty.handler.timeout.IdleState;
+import io.netty.handler.timeout.IdleStateEvent;
 import org.apache.tinkerpop.gremlin.driver.message.RequestMessage;
 import org.apache.tinkerpop.gremlin.driver.message.ResponseMessage;
 import org.apache.tinkerpop.gremlin.driver.message.ResponseStatusCode;
 import org.apache.tinkerpop.gremlin.groovy.engine.GremlinExecutor;
+import org.apache.tinkerpop.gremlin.server.Channelizer;
 import org.apache.tinkerpop.gremlin.server.Context;
 import org.apache.tinkerpop.gremlin.server.GraphManager;
 import org.apache.tinkerpop.gremlin.server.GremlinServer;
@@ -66,13 +69,24 @@ public class OpSelectorHandler extends MessageToMessageDecoder<RequestMessage> {
 
     private final GremlinExecutor gremlinExecutor;
     private final ScheduledExecutorService scheduledExecutorService;
+    private final Channelizer channelizer;
 
+    /**
+     * @deprecated As of release 3.2.8, replaced by {@link #OpSelectorHandler(Settings, GraphManager, GremlinExecutor, ScheduledExecutorService, Channelizer)}
+     */
+    @Deprecated
     public OpSelectorHandler(final Settings settings, final GraphManager graphManager, final GremlinExecutor gremlinExecutor,
                              final ScheduledExecutorService scheduledExecutorService) {
+        this(settings, graphManager, gremlinExecutor, scheduledExecutorService, null);
+    }
+
+    public OpSelectorHandler(final Settings settings, final GraphManager graphManager, final GremlinExecutor gremlinExecutor,
+                             final ScheduledExecutorService scheduledExecutorService, final Channelizer channelizer) {
         this.settings = settings;
         this.graphManager = graphManager;
         this.gremlinExecutor = gremlinExecutor;
         this.scheduledExecutorService = scheduledExecutorService;
+        this.channelizer = channelizer;
     }
 
     @Override
@@ -99,4 +113,25 @@ public class OpSelectorHandler extends MessageToMessageDecoder<RequestMessage> {
             ctx.writeAndFlush(ope.getResponseMessage());
         }
     }
+
+    @Override
+    public void userEventTriggered(final ChannelHandlerContext ctx, final Object evt) throws Exception {
+        // only need to handle this event if the idle monitor is on
+        if (!channelizer.supportsIdleMonitor()) return;
+
+        if (evt instanceof IdleStateEvent) {
+            final IdleStateEvent e = (IdleStateEvent) evt;
+
+            // if no requests (reader) then close, if no writes from server to client then ping. clients should
+            // periodically ping the server, but coming from this direction allows the server to kill channels that
+            // have dead clients on the other end
+            if (e.state() == IdleState.READER_IDLE) {
+                logger.info("Closing channel - client is disconnected after idle period of " + settings.idleReadLimit + " " + ctx.channel());
+                ctx.close();
+            } else if (e.state() == IdleState.WRITER_IDLE) {
+                logger.info("Checking channel - sending ping to client after idle period of " + settings.idleWriteLimit + " " + ctx.channel());
+                ctx.writeAndFlush(channelizer.createIdleDetectionMessage());
+            }
+        }
+    }
 }

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/10ab3341/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/handler/WsAndHttpChannelizerHandler.java
----------------------------------------------------------------------
diff --git a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/handler/WsAndHttpChannelizerHandler.java b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/handler/WsAndHttpChannelizerHandler.java
index 328a34b..6d32194 100644
--- a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/handler/WsAndHttpChannelizerHandler.java
+++ b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/handler/WsAndHttpChannelizerHandler.java
@@ -26,8 +26,10 @@ import io.netty.channel.EventLoopGroup;
 import io.netty.handler.codec.http.HttpMessage;
 import io.netty.handler.codec.http.websocketx.WebSocketServerProtocolHandler;
 import io.netty.handler.codec.http.HttpServerCodec;
+import org.apache.tinkerpop.gremlin.server.Channelizer;
 import org.apache.tinkerpop.gremlin.server.channel.HttpChannelizer;
 import org.apache.tinkerpop.gremlin.server.channel.WebSocketChannelizer;
+import org.apache.tinkerpop.gremlin.server.channel.WsAndHttpChannelizer;
 import org.apache.tinkerpop.gremlin.server.handler.HttpGremlinEndpointHandler;
 import org.apache.tinkerpop.gremlin.server.handler.WsAndHttpChannelizerHandler;
 import org.apache.tinkerpop.gremlin.server.handler.WebSocketHandlerUtil;
@@ -39,9 +41,10 @@ import static org.apache.tinkerpop.gremlin.server.channel.WebSocketChannelizer.P
 import static org.apache.tinkerpop.gremlin.server.channel.WebSocketChannelizer.PIPELINE_REQUEST_HANDLER;
 import static org.apache.tinkerpop.gremlin.server.channel.WebSocketChannelizer.PIPELINE_HTTP_RESPONSE_ENCODER;
 
-/*
+/**
  * A ChannelInboundHandlerAdapter for use with {@link WsAndHttpChannelizer} that toggles between WebSockets
- * and http
+ * and http.
+ *
  * @author Keith Lohnes lohnesk@gmail.com
  */
 @ChannelHandler.Sharable
@@ -56,6 +59,10 @@ public class WsAndHttpChannelizerHandler extends ChannelInboundHandlerAdapter {
         this.httpGremlinEndpointHandler = httpGremlinEndpointHandler;
     }
 
+    public Channelizer getWsChannelizer() {
+        return wsChannelizer;
+    }
+
     public void configure(final ChannelPipeline pipeline) {
         wsChannelizer.configure(pipeline);
     }

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/10ab3341/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 c401de6..55912e1 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
@@ -27,6 +27,7 @@ import io.netty.handler.ssl.util.SelfSignedCertificate;
 import org.apache.commons.configuration.BaseConfiguration;
 import org.apache.commons.configuration.Configuration;
 import org.apache.commons.lang.exception.ExceptionUtils;
+import org.apache.log4j.Level;
 import org.apache.log4j.Logger;
 import org.apache.tinkerpop.gremlin.TestHelper;
 import org.apache.tinkerpop.gremlin.driver.Client;
@@ -54,6 +55,7 @@ import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal;
 import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource;
 import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__;
 import org.apache.tinkerpop.gremlin.process.traversal.step.util.BulkSet;
+import org.apache.tinkerpop.gremlin.server.handler.OpSelectorHandler;
 import org.apache.tinkerpop.gremlin.server.op.AbstractEvalOpProcessor;
 import org.apache.tinkerpop.gremlin.server.op.standard.StandardOpProcessor;
 import org.apache.tinkerpop.gremlin.structure.Graph;
@@ -82,7 +84,6 @@ import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.TimeoutException;
 import java.util.concurrent.atomic.AtomicBoolean;
-import java.util.concurrent.atomic.AtomicInteger;
 import java.util.function.Supplier;
 import java.util.stream.Collectors;
 import java.util.stream.IntStream;
@@ -112,6 +113,7 @@ public class GremlinServerIntegrateTest extends AbstractGremlinServerIntegration
     private static final String KEY_PASS = "changeit";
     private static final String CLIENT_KEY = "src/test/resources/client.key.pk8";
     private static final String CLIENT_CRT = "src/test/resources/client.crt";
+    private Level previousLogLevel;
 
     private Log4jRecordingAppender recordingAppender = null;
     private final Supplier<Graph> graphGetter = () -> server.getServerGremlinExecutor().getGraphManager().getGraph("graph");
@@ -128,12 +130,26 @@ public class GremlinServerIntegrateTest extends AbstractGremlinServerIntegration
     public void setupForEachTest() {
         recordingAppender = new Log4jRecordingAppender();
         final Logger rootLogger = Logger.getRootLogger();
+
+        if (name.getMethodName().equals("shouldPingChannelIfClientDies")) {
+            final org.apache.log4j.Logger webSocketClientHandlerLogger = org.apache.log4j.Logger.getLogger(OpSelectorHandler.class);
+            previousLogLevel = webSocketClientHandlerLogger.getLevel();
+            webSocketClientHandlerLogger.setLevel(Level.INFO);
+        }
+
         rootLogger.addAppender(recordingAppender);
     }
 
     @After
     public void teardownForEachTest() {
         final Logger rootLogger = Logger.getRootLogger();
+
+        if (name.getMethodName().equals("shouldPingChannelIfClientDies")) {
+            final org.apache.log4j.Logger webSocketClientHandlerLogger = org.apache.log4j.Logger.getLogger(OpSelectorHandler.class);
+            previousLogLevel = webSocketClientHandlerLogger.getLevel();
+            webSocketClientHandlerLogger.setLevel(previousLogLevel);
+        }
+
         rootLogger.removeAppender(recordingAppender);
     }
 
@@ -234,6 +250,9 @@ public class GremlinServerIntegrateTest extends AbstractGremlinServerIntegration
             case "shouldTimeOutRemoteTraversal":
                 settings.scriptEvaluationTimeout = 500;
                 break;
+            case "shouldPingChannelIfClientDies":
+                settings.idleWriteLimit = 1000;
+                break;
         }
 
         return settings;
@@ -294,6 +313,21 @@ public class GremlinServerIntegrateTest extends AbstractGremlinServerIntegration
     }
 
     @Test
+    public void shouldPingChannelIfClientDies() throws Exception {
+        final Client client = TestClientFactory.build().maxConnectionPoolSize(1).minConnectionPoolSize(1).keepAliveInterval(0).create().connect();
+        client.submit("1+1").all().get();
+
+        // since we do nothing for 3 seconds and the time limit for ping is 1 second we should get *about* 3 pings -
+        // i don't think the assertion needs to be too accurate. just need to make sure there's a ping message out
+        // there record
+        Thread.sleep(3000);
+
+        assertThat(recordingAppender.logContainsAny(".*Checking channel - sending ping to client after idle period of .*$"), is(true));
+
+        client.close();
+    }
+
+    @Test
     public void shouldTimeOutRemoteTraversal() throws Exception {
         final Graph graph = EmptyGraph.instance();
         final GraphTraversalSource g = graph.traversal().withRemote(conf);

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/10ab3341/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/util/Log4jRecordingAppender.java
----------------------------------------------------------------------
diff --git a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/util/Log4jRecordingAppender.java b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/util/Log4jRecordingAppender.java
index e44f72f..82c14ac 100644
--- a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/util/Log4jRecordingAppender.java
+++ b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/util/Log4jRecordingAppender.java
@@ -60,7 +60,8 @@ public class Log4jRecordingAppender extends AppenderSkeleton {
         messages.clear();
     }
 
-    public boolean logContainsAny(final String fragment) {
-        return messages.stream().anyMatch(m -> m.contains(fragment));
+    public boolean logContainsAny(final String regex) {
+        // chop off the line feed so that the regex doesn't have to account for that
+        return messages.stream().anyMatch(m -> m.substring(0,m.length() - 1).matches(regex));
     }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/10ab3341/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/util/Log4jRecordingAppenderTest.java
----------------------------------------------------------------------
diff --git a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/util/Log4jRecordingAppenderTest.java b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/util/Log4jRecordingAppenderTest.java
index dd1ea63..624dfc4 100644
--- a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/util/Log4jRecordingAppenderTest.java
+++ b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/util/Log4jRecordingAppenderTest.java
@@ -69,7 +69,7 @@ public class Log4jRecordingAppenderTest {
 
     @Test
     public void shouldMatchAnyMessages() {
-        assertTrue(recordingAppender.logContainsAny("ERROR"));
+        assertTrue(recordingAppender.logContainsAny("ERROR.*"));
     }
 
     @Test

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

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

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


[4/8] tinkerpop git commit: TINKERPOP-1726 Added logging output for new settings

Posted by sp...@apache.org.
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/tp32
Commit: 00e4235c4abbb6b34702abdfb14b63a02398d9b6
Parents: a4bf937
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Tue Feb 20 09:26:03 2018 -0500
Committer: Stephen Mallette <sp...@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


[3/8] tinkerpop git commit: TINKERPOP-1726 updated changelog

Posted by sp...@apache.org.
TINKERPOP-1726 updated changelog


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

Branch: refs/heads/tp32
Commit: a4bf93798fd16061069816eb75b958de9f731ca4
Parents: 6cb73c7
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Tue Feb 20 08:23:37 2018 -0500
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Tue Feb 20 08:23:37 2018 -0500

----------------------------------------------------------------------
 CHANGELOG.asciidoc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/a4bf9379/CHANGELOG.asciidoc
----------------------------------------------------------------------
diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc
index f516f7b..69d402f 100644
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@ -25,7 +25,7 @@ image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/ima
 
 * Modified `GremlinDslProcessor` so that it generated the `getAnonymousTraversalClass()` method to return the DSL version of `__`.
 * Added the "Kitchen Sink" test data set.
-* Added `idleReadLimit` and `idleWriteLimit` to Gremlin Server that enables a "ping" and auto-close for seemingly dead clients.
+* Added `idleConnectionTimeout` and `keepAliveInterval` to Gremlin Server that enables a "ping" and auto-close for seemingly dead clients.
 * Fixed a bug in `NumberHelper` that led to wrong min/max results if numbers exceeded the Integer limits.
 * Delayed setting of the request identifier until `RequestMessage` construction by the builder.
 * Improved error messaging for failed serialization and deserialization of request/response messages.


[2/8] tinkerpop git commit: TINKERPOP-1726 Renamed settings to idleConnectionTimeout and keepAliveInterval

Posted by sp...@apache.org.
TINKERPOP-1726 Renamed settings to idleConnectionTimeout and keepAliveInterval


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

Branch: refs/heads/tp32
Commit: 6cb73c70bec0f867a3b6b60a674da73b0f4ea176
Parents: 10ab334
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Tue Feb 20 08:22:04 2018 -0500
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Tue Feb 20 08:22:04 2018 -0500

----------------------------------------------------------------------
 docs/src/reference/gremlin-applications.asciidoc          |  4 ++--
 docs/src/upgrade/release-3.2.x-incubating.asciidoc        | 10 +++++-----
 .../tinkerpop/gremlin/server/AbstractChannelizer.java     |  2 +-
 .../org/apache/tinkerpop/gremlin/server/Settings.java     | 10 +++++-----
 .../gremlin/server/handler/OpSelectorHandler.java         |  4 ++--
 .../gremlin/server/GremlinServerIntegrateTest.java        |  2 +-
 6 files changed, 16 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/6cb73c70/docs/src/reference/gremlin-applications.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/reference/gremlin-applications.asciidoc b/docs/src/reference/gremlin-applications.asciidoc
index 2413bdb..e84961c 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
-|idleReadLimit |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
-|idleWriteLimit |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 #idleReadLimit} and keep the channel open. If enabled, this number should be smaller than the value provided to the `idleReadLimit`. 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 `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
 |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/6cb73c70/docs/src/upgrade/release-3.2.x-incubating.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/upgrade/release-3.2.x-incubating.asciidoc b/docs/src/upgrade/release-3.2.x-incubating.asciidoc
index f623127..7d2a80c 100644
--- a/docs/src/upgrade/release-3.2.x-incubating.asciidoc
+++ b/docs/src/upgrade/release-3.2.x-incubating.asciidoc
@@ -31,11 +31,11 @@ Please see the link:https://github.com/apache/tinkerpop/blob/3.2.8/CHANGELOG.asc
 
 ==== Improved Connection Monitoring
 
-Gremlin Server now has two new settings: `idleReadLimit` and `idleWriteLimit`. The `idleWriteLimit` tells Gremlin
-Server how long it should wait between writes to a client before it issues a "ping" to that client to see if it is
-still present. The `idleReadLimit` represents how long Gremlin Server should wait between requests from a client before
-it closes the connection on the server side. By default, these two configurations are set to zero, meaning that they
-are both disabled.
+Gremlin Server now has two new settings: `idleConnectionTimeout` and `keepAliveInterval`. The `keepAliveInterval` tells
+Gremlin Server how long it should wait between writes to a client before it issues a "ping" to that client to see if
+it is still present. The `idleConnectionTimeout` represents how long Gremlin Server should wait between requests from
+a client before it closes the connection on the server side. By default, these two configurations are set to zero,
+meaning that they are both disabled.
 
 This change should help to alleviate issues where connections are left open on the server longer than they should be
 by clients that might mysteriously disappear without properly closing their connections.

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/6cb73c70/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 0bc4e00..bfb9660 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
@@ -154,7 +154,7 @@ 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.idleReadLimit / 1000), (int) (settings.idleWriteLimit / 1000),0));
+            pipeline.addLast(new IdleStateHandler((int) (settings.idleConnectionTimeout / 1000), (int) (settings.keepAliveInterval / 1000),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/6cb73c70/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 75466ca..ec2eaf9 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,17 +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 #idleWriteLimit}. Set this value to 0 to disable this feature.
+     * {@link #keepAliveInterval}. Set this value to 0 to disable this feature.
      */
-    public long idleReadLimit = 0;
+    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 #idleReadLimit} and keep the channel open. If enabled, this number should be smaller than
-     * the value provided to the {@link #idleReadLimit}. 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}. Set this value to 0 to disable this feature.
      */
-    public long idleWriteLimit = 0;
+    public long keepAliveInterval = 0;
 
     /**
      * If set to {@code true} the {@code aliases} option is required on requests and Gremlin Server will use that

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/6cb73c70/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/handler/OpSelectorHandler.java
----------------------------------------------------------------------
diff --git a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/handler/OpSelectorHandler.java b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/handler/OpSelectorHandler.java
index 8bb9c44..de65bb9 100644
--- a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/handler/OpSelectorHandler.java
+++ b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/handler/OpSelectorHandler.java
@@ -126,10 +126,10 @@ public class OpSelectorHandler extends MessageToMessageDecoder<RequestMessage> {
             // periodically ping the server, but coming from this direction allows the server to kill channels that
             // have dead clients on the other end
             if (e.state() == IdleState.READER_IDLE) {
-                logger.info("Closing channel - client is disconnected after idle period of " + settings.idleReadLimit + " " + ctx.channel());
+                logger.info("Closing channel - client is disconnected after idle period of " + settings.idleConnectionTimeout + " " + ctx.channel());
                 ctx.close();
             } else if (e.state() == IdleState.WRITER_IDLE) {
-                logger.info("Checking channel - sending ping to client after idle period of " + settings.idleWriteLimit + " " + ctx.channel());
+                logger.info("Checking channel - sending ping to client after idle period of " + settings.keepAliveInterval + " " + ctx.channel());
                 ctx.writeAndFlush(channelizer.createIdleDetectionMessage());
             }
         }

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/6cb73c70/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 55912e1..033c847 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
@@ -251,7 +251,7 @@ public class GremlinServerIntegrateTest extends AbstractGremlinServerIntegration
                 settings.scriptEvaluationTimeout = 500;
                 break;
             case "shouldPingChannelIfClientDies":
-                settings.idleWriteLimit = 1000;
+                settings.keepAliveInterval = 1000;
                 break;
         }
 


[7/8] tinkerpop git commit: TINKERPOP=-1726 Just make it so that WsAndHttp supports idle monitor

Posted by sp...@apache.org.
TINKERPOP=-1726 Just make it so that WsAndHttp supports idle monitor


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

Branch: refs/heads/tp32
Commit: 12818789d400e5a6830f4478fa67704eec08eb92
Parents: a082e63
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Tue Feb 20 13:19:12 2018 -0500
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Tue Feb 20 13:19:12 2018 -0500

----------------------------------------------------------------------
 .../tinkerpop/gremlin/server/channel/WsAndHttpChannelizer.java     | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/12818789/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/channel/WsAndHttpChannelizer.java
----------------------------------------------------------------------
diff --git a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/channel/WsAndHttpChannelizer.java b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/channel/WsAndHttpChannelizer.java
index e415887..de521a3 100644
--- a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/channel/WsAndHttpChannelizer.java
+++ b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/channel/WsAndHttpChannelizer.java
@@ -49,7 +49,7 @@ public class WsAndHttpChannelizer extends AbstractChannelizer {
 
     @Override
     public boolean supportsIdleMonitor() {
-        return handler.getWsChannelizer().supportsIdleMonitor();
+        return true;
     }
 
     @Override


[6/8] tinkerpop git commit: TINKERPOP-1726 Minor fix to ascidoc format

Posted by sp...@apache.org.
TINKERPOP-1726 Minor fix to ascidoc format


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

Branch: refs/heads/tp32
Commit: a082e63e6a999411fceb618c66d49e214ed52ff7
Parents: da48b74
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Tue Feb 20 10:56:29 2018 -0500
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Tue Feb 20 10:56:29 2018 -0500

----------------------------------------------------------------------
 docs/src/reference/gremlin-applications.asciidoc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/a082e63e/docs/src/reference/gremlin-applications.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/reference/gremlin-applications.asciidoc b/docs/src/reference/gremlin-applications.asciidoc
index 5443ee2..380ff4e 100644
--- a/docs/src/reference/gremlin-applications.asciidoc
+++ b/docs/src/reference/gremlin-applications.asciidoc
@@ -1074,7 +1074,7 @@ The following table describes the various configuration options that Gremlin Ser
 |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 `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
+|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


[8/8] tinkerpop git commit: Merge branch 'TINKERPOP-1726' into tp32

Posted by sp...@apache.org.
Merge branch 'TINKERPOP-1726' into tp32


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

Branch: refs/heads/tp32
Commit: d9705644360763e7eff139358ae864c314925bd9
Parents: 3df6c58 1281878
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Fri Feb 23 07:02:24 2018 -0500
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Fri Feb 23 07:02:24 2018 -0500

----------------------------------------------------------------------
 CHANGELOG.asciidoc                              |  1 +
 .../src/reference/gremlin-applications.asciidoc | 13 +++--
 .../upgrade/release-3.2.x-incubating.asciidoc   | 15 ++++++
 .../driver/handler/WebSocketClientHandler.java  |  5 +-
 gremlin-server/conf/gremlin-server-classic.yaml |  2 +
 .../conf/gremlin-server-modern-py.yaml          |  2 +
 .../conf/gremlin-server-modern-readonly.yaml    |  2 +
 gremlin-server/conf/gremlin-server-modern.yaml  |  2 +
 gremlin-server/conf/gremlin-server-neo4j.yaml   |  2 +
 gremlin-server/conf/gremlin-server-secure.yaml  |  2 +
 gremlin-server/conf/gremlin-server-spark.yaml   |  2 +
 gremlin-server/conf/gremlin-server.yaml         |  2 +
 .../gremlin/server/AbstractChannelizer.java     | 14 ++++-
 .../tinkerpop/gremlin/server/Channelizer.java   | 17 ++++++
 .../tinkerpop/gremlin/server/GremlinServer.java | 11 +++-
 .../tinkerpop/gremlin/server/Settings.java      | 18 ++++++-
 .../server/channel/WebSocketChannelizer.java    | 11 ++++
 .../server/channel/WsAndHttpChannelizer.java    | 28 +++++-----
 .../server/handler/OpSelectorHandler.java       | 35 +++++++++++++
 .../handler/WsAndHttpChannelizerHandler.java    | 11 +++-
 .../server/GremlinServerIntegrateTest.java      | 55 +++++++++++++++++++-
 .../gremlin/util/Log4jRecordingAppender.java    |  5 +-
 .../util/Log4jRecordingAppenderTest.java        |  2 +-
 .../remote/gremlin-server-integration.yaml      |  2 +
 .../server/gremlin-server-integration.yaml      |  2 +
 .../server/gremlin-server-performance.yaml      |  2 +
 26 files changed, 232 insertions(+), 31 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d9705644/CHANGELOG.asciidoc
----------------------------------------------------------------------


[5/8] tinkerpop git commit: TINKERPOP-1726 Added test to check if server auto-closes channels properly

Posted by sp...@apache.org.
TINKERPOP-1726 Added test to check if server auto-closes channels properly


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

Branch: refs/heads/tp32
Commit: da48b74b1e10065978f4905693c3b97dad257a0a
Parents: 00e4235
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Tue Feb 20 09:54:01 2018 -0500
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Tue Feb 20 09:54:01 2018 -0500

----------------------------------------------------------------------
 .../server/GremlinServerIntegrateTest.java      | 23 ++++++++++++++++++--
 1 file changed, 21 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/da48b74b/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 033c847..1db7a50 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
@@ -131,7 +131,8 @@ public class GremlinServerIntegrateTest extends AbstractGremlinServerIntegration
         recordingAppender = new Log4jRecordingAppender();
         final Logger rootLogger = Logger.getRootLogger();
 
-        if (name.getMethodName().equals("shouldPingChannelIfClientDies")) {
+        if (name.getMethodName().equals("shouldPingChannelIfClientDies") ||
+                name.getMethodName().equals("shouldCloseChannelIfClientDoesntRespond")) {
             final org.apache.log4j.Logger webSocketClientHandlerLogger = org.apache.log4j.Logger.getLogger(OpSelectorHandler.class);
             previousLogLevel = webSocketClientHandlerLogger.getLevel();
             webSocketClientHandlerLogger.setLevel(Level.INFO);
@@ -144,7 +145,8 @@ public class GremlinServerIntegrateTest extends AbstractGremlinServerIntegration
     public void teardownForEachTest() {
         final Logger rootLogger = Logger.getRootLogger();
 
-        if (name.getMethodName().equals("shouldPingChannelIfClientDies")) {
+        if (name.getMethodName().equals("shouldPingChannelIfClientDies")||
+                name.getMethodName().equals("shouldCloseChannelIfClientDoesntRespond")) {
             final org.apache.log4j.Logger webSocketClientHandlerLogger = org.apache.log4j.Logger.getLogger(OpSelectorHandler.class);
             previousLogLevel = webSocketClientHandlerLogger.getLevel();
             webSocketClientHandlerLogger.setLevel(previousLogLevel);
@@ -253,6 +255,9 @@ public class GremlinServerIntegrateTest extends AbstractGremlinServerIntegration
             case "shouldPingChannelIfClientDies":
                 settings.keepAliveInterval = 1000;
                 break;
+            case "shouldCloseChannelIfClientDoesntRespond":
+                settings.idleConnectionTimeout = 1000;
+                break;
         }
 
         return settings;
@@ -313,6 +318,20 @@ public class GremlinServerIntegrateTest extends AbstractGremlinServerIntegration
     }
 
     @Test
+    public void shouldCloseChannelIfClientDoesntRespond() throws Exception {
+        final SimpleClient client = TestClientFactory.createWebSocketClient();
+        client.submit("1+1");
+
+        // since we do nothing for 2 seconds and the time limit for timeout on the server is 1 second, the server
+        // will autoclose the channel
+        Thread.sleep(2000);
+
+        assertThat(recordingAppender.logContainsAny(".*Closing channel - client is disconnected after idle period of .*$"), is(true));
+
+        client.close();
+    }
+
+    @Test
     public void shouldPingChannelIfClientDies() throws Exception {
         final Client client = TestClientFactory.build().maxConnectionPoolSize(1).minConnectionPoolSize(1).keepAliveInterval(0).create().connect();
         client.submit("1+1").all().get();