tinkerpop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From spmalle...@apache.org
Subject [1/4] tinkerpop git commit: TINKERPOP-1296 Removed deprecated serializedResponseTimeout from Gremlin Server
Date Tue, 08 May 2018 12:27:46 GMT
Repository: tinkerpop
Updated Branches:
  refs/heads/master 9bff0f439 -> 1818c8933


TINKERPOP-1296 Removed deprecated serializedResponseTimeout from Gremlin Server


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

Branch: refs/heads/master
Commit: f1237587ea4d691f691f55c6b6c42de1f7c52a9d
Parents: 908107c
Author: Stephen Mallette <spmva@genoprime.com>
Authored: Wed Apr 25 21:34:43 2018 -0400
Committer: Stephen Mallette <spmva@genoprime.com>
Committed: Thu Apr 26 06:37:30 2018 -0400

----------------------------------------------------------------------
 CHANGELOG.asciidoc                              |  1 +
 docs/src/upgrade/release-3.4.x.asciidoc         |  2 ++
 .../src/test/resources/gremlin-server.yaml      |  1 -
 .../tinkerpop/gremlin/server/Settings.java      |  9 -------
 .../gremlin/server/op/AbstractOpProcessor.java  | 25 ++------------------
 .../op/traversal/TraversalOpProcessor.java      |  9 -------
 .../server/GremlinServerIntegrateTest.java      | 24 -------------------
 7 files changed, 5 insertions(+), 66 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/f1237587/CHANGELOG.asciidoc
----------------------------------------------------------------------
diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc
index 3248bf1..84ecdc4 100644
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@ -32,6 +32,7 @@ This release also includes changes from <<release-3-3-3, 3.3.3>>.
 * Changed the order of `select()` scopes. The order is now: maps, side-effects, paths.
 * Removed previously deprecated Credentials DSL infrastructure.
 * Moved `TraversalEngine` to `gremlin-test` as it has long been only used in testing infrastructure.
+* Removed previously deprecated Gremlin Server setting for `serializedResponseTimeout`.
 * Removed previously deprecated Structure API exceptions related to "element not found" situations.
 * Removed previously deprecated `rebindings` options from the Java driver API.
 * Removed previously deprecated `AuthenticationSettings.className` configuration option in
Gremlin Server.

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/f1237587/docs/src/upgrade/release-3.4.x.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/upgrade/release-3.4.x.asciidoc b/docs/src/upgrade/release-3.4.x.asciidoc
index 6f47646..c486df8 100644
--- a/docs/src/upgrade/release-3.4.x.asciidoc
+++ b/docs/src/upgrade/release-3.4.x.asciidoc
@@ -92,12 +92,14 @@ The following deprecated classes, methods or fields have been removed
in this ve
 ** `org.apache.tinkerpop.gremlin.driver.Client.ReboundClusterdClient`
 ** `org.apache.tinkerpop.gremlin.driver.Tokens#ARGS_REBINDINGS`
 * `gremlin-server`
+** `org.apache.tinkerpop.gremlin.server.Settings.serializedResponseTimeout`
 ** `org.apache.tinkerpop.gremlin.server.Settings.AuthenticationSettings.className`
 
 Please see the javadoc deprecation notes or upgrade documentation specific to when the deprecation
took place to
 understand how to resolve this breaking change.
 
 See: link:https://issues.apache.org/jira/browse/TINKERPOP-1143[TINKERPOP-1143],
+link:https://issues.apache.org/jira/browse/TINKERPOP-1296[TINKERPOP-1296],
 link:https://issues.apache.org/jira/browse/TINKERPOP-1705[TINKERPOP-1705],
 link:https://issues.apache.org/jira/browse/TINKERPOP-1707[TINKERPOP-1707]
 

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/f1237587/gremlin-archetype/gremlin-archetype-server/src/main/resources/archetype-resources/src/test/resources/gremlin-server.yaml
----------------------------------------------------------------------
diff --git a/gremlin-archetype/gremlin-archetype-server/src/main/resources/archetype-resources/src/test/resources/gremlin-server.yaml
b/gremlin-archetype/gremlin-archetype-server/src/main/resources/archetype-resources/src/test/resources/gremlin-server.yaml
index f5613ef..fb5e140 100644
--- a/gremlin-archetype/gremlin-archetype-server/src/main/resources/archetype-resources/src/test/resources/gremlin-server.yaml
+++ b/gremlin-archetype/gremlin-archetype-server/src/main/resources/archetype-resources/src/test/resources/gremlin-server.yaml
@@ -20,7 +20,6 @@ port: 45940
 threadPoolWorker: 1
 gremlinPool: 8
 scriptEvaluationTimeout: 30000
-serializedResponseTimeout: 30000
 graphs: {
   graph: conf/tinkergraph-empty.properties}
 scriptEngines: {

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/f1237587/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 66fcd86..3066b2c 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
@@ -104,15 +104,6 @@ public class Settings {
     public long scriptEvaluationTimeout = 30000L;
 
     /**
-     * Time in milliseconds to wait while an evaluated script serializes its results. This
value represents the
-     * total serialization time allowed for the request.  Defaults to 0 which disables this
setting.
-     *
-     * @deprecated As of release 3.2.1, replaced wholly by {@link #scriptEvaluationTimeout}.
-     */
-    @Deprecated
-    public long serializedResponseTimeout = 0L;
-
-    /**
      * Number of items in a particular resultset to iterate and serialize prior to pushing
the data down the wire
      * to the client.
      */

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/f1237587/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/op/AbstractOpProcessor.java
----------------------------------------------------------------------
diff --git a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/op/AbstractOpProcessor.java
b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/op/AbstractOpProcessor.java
index fd2d27f..8e4c1c2 100644
--- a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/op/AbstractOpProcessor.java
+++ b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/op/AbstractOpProcessor.java
@@ -19,7 +19,6 @@
 package org.apache.tinkerpop.gremlin.server.op;
 
 import io.netty.channel.ChannelHandlerContext;
-import org.apache.commons.lang.time.StopWatch;
 import org.apache.tinkerpop.gremlin.driver.MessageSerializer;
 import org.apache.tinkerpop.gremlin.driver.Tokens;
 import org.apache.tinkerpop.gremlin.driver.message.RequestMessage;
@@ -43,7 +42,6 @@ import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 import java.util.concurrent.TimeUnit;
-import java.util.concurrent.TimeoutException;
 
 /**
  * A base {@link OpProcessor} implementation that processes an {@code Iterator} of results
in a generalized way while
@@ -64,16 +62,12 @@ public abstract class AbstractOpProcessor implements OpProcessor {
     }
 
     /**
-     * Provides a generic way of iterating a result set back to the client. Implementers
should respect the
-     * {@link Settings#serializedResponseTimeout} configuration and break the serialization
process if
-     * it begins to take too long to do so, throwing a {@link java.util.concurrent.TimeoutException}
in such
-     * cases.
+     * Provides a generic way of iterating a result set back to the client.
      *
      * @param context The Gremlin Server {@link Context} object containing settings, request
message, etc.
      * @param itty The result to iterator
-     * @throws TimeoutException if the time taken to serialize the entire result set exceeds
the allowable time.
      */
-    protected void handleIterator(final Context context, final Iterator itty) throws TimeoutException,
InterruptedException {
+    protected void handleIterator(final Context context, final Iterator itty) throws InterruptedException
{
         final ChannelHandlerContext ctx = context.getChannelHandlerContext();
         final RequestMessage msg = context.getRequestMessage();
         final Settings settings = context.getSettings();
@@ -96,10 +90,6 @@ public abstract class AbstractOpProcessor implements OpProcessor {
             return;
         }
 
-        // timer for the total serialization time
-        final StopWatch stopWatch = new StopWatch();
-        stopWatch.start();
-
         // the batch size can be overridden by the request
         final int resultIterationBatchSize = (Integer) msg.optionalArgs(Tokens.ARGS_BATCH_SIZE)
                 .orElse(settings.resultIterationBatchSize);
@@ -204,18 +194,7 @@ public abstract class AbstractOpProcessor implements OpProcessor {
                 // this isn't blocking the IO thread - just a worker.
                 TimeUnit.MILLISECONDS.sleep(10);
             }
-
-            stopWatch.split();
-            if (settings.serializedResponseTimeout > 0 && stopWatch.getSplitTime()
> settings.serializedResponseTimeout) {
-                final String timeoutMsg = String.format("Serialization of the entire response
exceeded the 'serializeResponseTimeout' setting %s",
-                        warnOnce ? "[Gremlin Server paused writes to client as messages were
not being consumed quickly enough]" : "");
-                throw new TimeoutException(timeoutMsg.trim());
-            }
-
-            stopWatch.unsplit();
         }
-
-        stopWatch.stop();
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/f1237587/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/op/traversal/TraversalOpProcessor.java
----------------------------------------------------------------------
diff --git a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/op/traversal/TraversalOpProcessor.java
b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/op/traversal/TraversalOpProcessor.java
index 9025108..ca035c7 100644
--- a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/op/traversal/TraversalOpProcessor.java
+++ b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/op/traversal/TraversalOpProcessor.java
@@ -68,7 +68,6 @@ import java.util.UUID;
 import java.util.concurrent.Future;
 import java.util.concurrent.FutureTask;
 import java.util.concurrent.TimeUnit;
-import java.util.concurrent.TimeoutException;
 
 import static com.codahale.metrics.MetricRegistry.name;
 
@@ -301,14 +300,6 @@ public class TraversalOpProcessor extends AbstractOpProcessor {
                         }
 
                         handleIterator(context, new SideEffectIterator(sideEffects.get(sideEffectKey.get()),
sideEffectKey.get()));
-                    } catch (TimeoutException ex) {
-                        final String errorMessage = String.format("Response iteration exceeded
the configured threshold for request [%s] - %s", msg.getRequestId(), ex.getMessage());
-                        logger.warn(errorMessage);
-                        ctx.writeAndFlush(ResponseMessage.build(msg).code(ResponseStatusCode.SERVER_ERROR_TIMEOUT)
-                                .statusMessage(errorMessage)
-                                .statusAttributeException(ex).create());
-                        onError(graph, context);
-                        return;
                     } catch (Exception ex) {
                         logger.warn(String.format("Exception processing a side-effect on
iteration for request [%s].", msg.getRequestId()), ex);
                         ctx.writeAndFlush(ResponseMessage.build(msg).code(ResponseStatusCode.SERVER_ERROR)

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/f1237587/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 10bca7e..08b8526 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
@@ -59,7 +59,6 @@ import org.apache.tinkerpop.gremlin.server.op.standard.StandardOpProcessor;
 import org.apache.tinkerpop.gremlin.structure.Graph;
 import org.apache.tinkerpop.gremlin.structure.T;
 import org.apache.tinkerpop.gremlin.structure.Vertex;
-import org.apache.tinkerpop.gremlin.structure.util.detached.DetachedVertex;
 import org.apache.tinkerpop.gremlin.structure.util.empty.EmptyGraph;
 import org.apache.tinkerpop.gremlin.util.Log4jRecordingAppender;
 import org.apache.tinkerpop.gremlin.util.function.Lambda;
@@ -70,7 +69,6 @@ import org.junit.Test;
 
 import java.lang.reflect.Field;
 import java.nio.channels.ClosedChannelException;
-import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -92,7 +90,6 @@ import static org.hamcrest.CoreMatchers.is;
 import static org.hamcrest.MatcherAssert.assertThat;
 import static org.hamcrest.core.IsInstanceOf.instanceOf;
 import static org.hamcrest.core.IsNot.not;
-import static org.hamcrest.core.StringEndsWith.endsWith;
 import static org.hamcrest.core.StringStartsWith.startsWith;
 import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertTrue;
@@ -177,9 +174,6 @@ public class GremlinServerIntegrateTest extends AbstractGremlinServerIntegration
             case "shouldReceiveFailureTimeOutOnScriptEval":
                 settings.scriptEvaluationTimeout = 1000;
                 break;
-            case "shouldReceiveFailureTimeOutOnTotalSerialization":
-                settings.serializedResponseTimeout = 1;
-                break;
             case "shouldBlockRequestWhenTooBig":
                 settings.maxContentLength = 1024;
                 break;
@@ -811,24 +805,6 @@ public class GremlinServerIntegrateTest extends AbstractGremlinServerIntegration
         }
     }
 
-    /**
-     * @deprecated As of release 3.2.1, replaced by tests covering {@link Settings#scriptEvaluationTimeout}.
-     */
-    @Test
-    @SuppressWarnings("unchecked")
-    @Deprecated
-    public void shouldReceiveFailureTimeOutOnTotalSerialization() throws Exception {
-        try (SimpleClient client = TestClientFactory.createWebSocketClient()){
-            final List<ResponseMessage> responses = client.submit("(0..<100000)");
-
-            // the last message should contain the error
-            assertThat(responses.get(responses.size() - 1).getStatus().getMessage(), endsWith("Serialization
of the entire response exceeded the 'serializeResponseTimeout' setting"));
-
-            // validate that we can still send messages to the server
-            assertEquals(2, ((List<Integer>) client.submit("1+1").get(0).getResult().getData()).get(0).intValue());
-        }
-    }
-
     @Test
     @SuppressWarnings("unchecked")
     public void shouldLoadInitScript() throws Exception {


Mime
View raw message