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 2019/09/19 10:42:46 UTC

[tinkerpop] branch master updated (bd4ad6b -> 5b32295)

This is an automated email from the ASF dual-hosted git repository.

spmallette pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/tinkerpop.git.


    from bd4ad6b  Merge branch 'tp34'
     add 429ff28  TINKERPOP-2213 Deprecated scriptEvaluationTimeout for evaluationTimeout
     new 8add715  Merge branch 'tp33' into tp34
     new 5b32295  Merge branch 'tp34'

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 CHANGELOG.asciidoc                                 |  2 +
 docs/src/dev/provider/index.asciidoc               |  4 +-
 docs/src/reference/gremlin-applications.asciidoc   |  8 +--
 docs/src/upgrade/release-3.3.x.asciidoc            | 14 +++++
 .../src/test/resources/gremlin-server.yaml         |  2 +-
 .../console/jsr223/gremlin-server-integration.yaml |  2 +-
 gremlin-dotnet/src/Gremlin.Net/Driver/Tokens.cs    |  6 +-
 .../Driver/MessagesTests.cs                        |  2 +-
 .../apache/tinkerpop/gremlin/driver/Tokens.java    |  6 ++
 .../gremlin/groovy/engine/GremlinExecutor.java     | 63 ++++++++++++++-----
 .../groovy/jsr223/GroovyCompilerGremlinPlugin.java |  2 +-
 .../gremlin/groovy/engine/GremlinExecutorTest.java | 71 +++++++++++++++++++++-
 gremlin-server/conf/gremlin-server-classic.yaml    |  2 +-
 gremlin-server/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 +-
 .../conf/gremlin-server-rest-modern.yaml           |  2 +-
 .../conf/gremlin-server-rest-secure.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 +-
 .../apache/tinkerpop/gremlin/server/Settings.java  | 18 +++++-
 .../gremlin/server/op/AbstractEvalOpProcessor.java | 12 ++--
 .../gremlin/server/op/session/Session.java         |  2 +-
 .../server/op/traversal/TraversalOpProcessor.java  | 15 +++--
 .../gremlin/server/util/ServerGremlinExecutor.java |  4 +-
 .../AbstractGremlinServerIntegrationTest.java      |  8 +--
 .../gremlin/server/GremlinDriverIntegrateTest.java |  6 +-
 .../gremlin/server/GremlinServerIntegrateTest.java | 57 +++++++++++++++--
 .../server/GremlinServerSessionIntegrateTest.java  |  2 +-
 .../gremlin/server/gremlin-server-integration.yaml |  2 +-
 32 files changed, 260 insertions(+), 68 deletions(-)


[tinkerpop] 01/02: Merge branch 'tp33' into tp34

Posted by sp...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

spmallette pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tinkerpop.git

commit 8add7157b7919cd58677b405a28122bce473ccaa
Merge: 82c347a 429ff28
Author: Stephen Mallette <sp...@genoprime.com>
AuthorDate: Thu Sep 19 06:41:11 2019 -0400

    Merge branch 'tp33' into tp34

 CHANGELOG.asciidoc                                 |  2 +
 docs/src/dev/provider/index.asciidoc               |  4 +-
 docs/src/reference/gremlin-applications.asciidoc   |  8 +--
 docs/src/upgrade/release-3.3.x.asciidoc            | 14 +++++
 .../src/test/resources/gremlin-server.yaml         |  2 +-
 .../console/jsr223/gremlin-server-integration.yaml |  2 +-
 gremlin-dotnet/src/Gremlin.Net/Driver/Tokens.cs    |  6 +-
 .../Driver/MessagesTests.cs                        |  2 +-
 .../apache/tinkerpop/gremlin/driver/Tokens.java    |  6 ++
 .../gremlin/groovy/engine/GremlinExecutor.java     | 63 ++++++++++++++-----
 .../groovy/jsr223/GroovyCompilerGremlinPlugin.java |  2 +-
 .../gremlin/groovy/engine/GremlinExecutorTest.java | 71 +++++++++++++++++++++-
 gremlin-server/conf/gremlin-server-classic.yaml    |  2 +-
 gremlin-server/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 +-
 .../conf/gremlin-server-rest-modern.yaml           |  2 +-
 .../conf/gremlin-server-rest-secure.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 +-
 .../apache/tinkerpop/gremlin/server/Settings.java  | 18 +++++-
 .../gremlin/server/op/AbstractEvalOpProcessor.java | 12 ++--
 .../gremlin/server/op/session/Session.java         |  2 +-
 .../server/op/traversal/TraversalOpProcessor.java  | 15 +++--
 .../gremlin/server/util/ServerGremlinExecutor.java |  4 +-
 .../AbstractGremlinServerIntegrationTest.java      |  8 +--
 .../gremlin/server/GremlinDriverIntegrateTest.java |  6 +-
 .../gremlin/server/GremlinServerIntegrateTest.java | 57 +++++++++++++++--
 .../server/GremlinServerSessionIntegrateTest.java  |  2 +-
 .../gremlin/server/gremlin-server-integration.yaml |  2 +-
 32 files changed, 260 insertions(+), 68 deletions(-)

diff --cc gremlin-archetype/gremlin-archetype-server/src/main/resources/archetype-resources/src/test/resources/gremlin-server.yaml
index fb5e140,1d2b4d8..9530b50
--- 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
@@@ -19,7 -19,8 +19,7 @@@ host: localhos
  port: 45940
  threadPoolWorker: 1
  gremlinPool: 8
- scriptEvaluationTimeout: 30000
+ evaluationTimeout: 30000
 -serializedResponseTimeout: 30000
  graphs: {
    graph: conf/tinkergraph-empty.properties}
  scriptEngines: {
diff --cc gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/Settings.java
index 5b5c7f0,6dbbb30..106a026
--- 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
@@@ -101,11 -101,30 +101,21 @@@ public class Settings 
      public int threadPoolBoss = 1;
  
      /**
-      * Time in milliseconds to wait for a script to complete execution.  Defaults to 30000.
+      * Time in milliseconds to wait for a request (script or bytecode) to complete execution.  Defaults to -1 and
+      * thus defers to {@link #evaluationTimeout} for this configuration. When set to something greater than -1 then
+      * this configuration is used.
+      *
+      * @deprecated As of release 3.3.9, replaced by {@link #evaluationTimeout}.
       */
-     public long scriptEvaluationTimeout = 30000L;
+     @Deprecated
+     public long scriptEvaluationTimeout = -1L;
+ 
+     /**
+      * Time in milliseconds to wait for a request (script or bytecode) to complete execution. Defaults to 30000.
+      */
+     public long evaluationTimeout = 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 #evaluationTimeout}.
 -     */
 -    @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.
       */
diff --cc gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinDriverIntegrateTest.java
index bf386b2,224f0ca..d176685
--- a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinDriverIntegrateTest.java
+++ b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinDriverIntegrateTest.java
@@@ -188,11 -177,8 +188,11 @@@ public class GremlinDriverIntegrateTes
                  break;
              case "shouldProcessTraversalInterruption":
              case "shouldProcessEvalInterruption":
-                 settings.scriptEvaluationTimeout = 1500;
+                 settings.evaluationTimeout = 1500;
                  break;
 +            case "shouldProcessEvalTimeoutOverride":
 +                settings.scriptEvaluationTimeout = 15000;
 +                break;
          }
  
          return settings;
diff --cc gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerIntegrateTest.java
index 0dad42f,82e4f67..9d34eef
--- 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
@@@ -172,8 -173,11 +172,8 @@@ public class GremlinServerIntegrateTes
                  settings.writeBufferLowWaterMark = 32;
                  break;
              case "shouldReceiveFailureTimeOutOnScriptEval":
-                 settings.scriptEvaluationTimeout = 1000;
+                 settings.evaluationTimeout = 1000;
                  break;
 -            case "shouldReceiveFailureTimeOutOnTotalSerialization":
 -                settings.serializedResponseTimeout = 1;
 -                break;
              case "shouldBlockRequestWhenTooBig":
                  settings.maxContentLength = 1024;
                  break;
@@@ -415,34 -422,34 +418,62 @@@
      }
  
      @Test
+     public void shouldTimeOutRemoteTraversalUsingDeprecatedConfiguration() throws Exception {
+         final GraphTraversalSource g = traversal().withRemote(conf);
+ 
+         try {
+             // tests sleeping thread
+             g.inject(1).sideEffect(Lambda.consumer("Thread.sleep(10000)")).iterate();
+             fail("This traversal should have timed out");
+         } catch (Exception ex) {
+             final Throwable t = ex.getCause();
+             assertThat(t, instanceOf(ResponseException.class));
+             assertEquals(ResponseStatusCode.SERVER_ERROR_TIMEOUT, ((ResponseException) t).getResponseStatusCode());
+         }
+ 
+         // make a graph with a cycle in it to force a long run traversal
+         graphGetter.get().traversal().addV("person").as("p").addE("self").to("p").iterate();
+ 
+         try {
+             // tests an "unending" traversal
+             g.V().repeat(__.out()).until(__.outE().count().is(0)).iterate();
+             fail("This traversal should have timed out");
+         } catch (Exception ex) {
+             final Throwable t = ex.getCause();
+             assertThat(t, instanceOf(ResponseException.class));
+             assertEquals(ResponseStatusCode.SERVER_ERROR_TIMEOUT, ((ResponseException) t).getResponseStatusCode());
+         }
+     }
+ 
+     @Test
 +    public void shouldTimeOutRemoteTraversalWithPerRequestOption() {
 +        final GraphTraversalSource g = traversal().withRemote(conf);
 +
 +        try {
 +            // tests sleeping thread
 +            g.with(ARGS_SCRIPT_EVAL_TIMEOUT, 500L).inject(1).sideEffect(Lambda.consumer("Thread.sleep(10000)")).iterate();
 +            fail("This traversal should have timed out");
 +        } catch (Exception ex) {
 +            final Throwable t = ex.getCause();
 +            assertThat(t, instanceOf(ResponseException.class));
 +            assertEquals(ResponseStatusCode.SERVER_ERROR_TIMEOUT, ((ResponseException) t).getResponseStatusCode());
 +        }
 +
 +        // make a graph with a cycle in it to force a long run traversal
 +        graphGetter.get().traversal().addV("person").as("p").addE("self").to("p").iterate();
 +
 +        try {
 +            // tests an "unending" traversal
 +            g.with(ARGS_SCRIPT_EVAL_TIMEOUT, 500L).V().repeat(__.out()).until(__.outE().count().is(0)).iterate();
 +            fail("This traversal should have timed out");
 +        } catch (Exception ex) {
 +            final Throwable t = ex.getCause();
 +            assertThat(t, instanceOf(ResponseException.class));
 +            assertEquals(ResponseStatusCode.SERVER_ERROR_TIMEOUT, ((ResponseException) t).getResponseStatusCode());
 +        }
 +    }
 +
 +    @Test
      public void shouldProduceProperExceptionOnTimeout() throws Exception {
          final Cluster cluster = TestClientFactory.open();
          final Client client = cluster.connect(name.getMethodName());
diff --cc gremlin-server/src/test/resources/org/apache/tinkerpop/gremlin/server/gremlin-server-integration.yaml
index 5bcd81f,4eae54c..adf05cd
--- 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
@@@ -15,22 -15,9 +15,22 @@@
  # specific language governing permissions and limitations
  # under the License.
  
 +###############################################################################
 +# IMPORTANT
 +###############################################################################
 +# Changes to this file need to be appropriately replicated to
 +#
 +# - docker/gremlin-server/gremlin-server-integration.yaml
 +# - docker/gremlin-server/gremlin-server-integration-secure.yaml
 +#
 +# Without such changes, the test docker server can't be started for independent
 +# testing with Gremlin Language Variants. Note this file's relation to
 +# gremlin-server/src/test/resources/scripts/test-server-start.groovy
 +###############################################################################
 +
  host: localhost
  port: 45940
- scriptEvaluationTimeout: 30000
+ evaluationTimeout: 30000
  graphs: {
    graph: conf/tinkergraph-empty.properties,
    classic: conf/tinkergraph-empty.properties,


[tinkerpop] 02/02: Merge branch 'tp34'

Posted by sp...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

spmallette pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tinkerpop.git

commit 5b32295c4a228f47c3fe11819468aee57d7ae981
Merge: bd4ad6b 8add715
Author: Stephen Mallette <sp...@genoprime.com>
AuthorDate: Thu Sep 19 06:42:28 2019 -0400

    Merge branch 'tp34'

 CHANGELOG.asciidoc                                 |  2 +
 docs/src/dev/provider/index.asciidoc               |  4 +-
 docs/src/reference/gremlin-applications.asciidoc   |  8 +--
 docs/src/upgrade/release-3.3.x.asciidoc            | 14 +++++
 .../src/test/resources/gremlin-server.yaml         |  2 +-
 .../console/jsr223/gremlin-server-integration.yaml |  2 +-
 gremlin-dotnet/src/Gremlin.Net/Driver/Tokens.cs    |  6 +-
 .../Driver/MessagesTests.cs                        |  2 +-
 .../apache/tinkerpop/gremlin/driver/Tokens.java    |  6 ++
 .../gremlin/groovy/engine/GremlinExecutor.java     | 63 ++++++++++++++-----
 .../groovy/jsr223/GroovyCompilerGremlinPlugin.java |  2 +-
 .../gremlin/groovy/engine/GremlinExecutorTest.java | 71 +++++++++++++++++++++-
 gremlin-server/conf/gremlin-server-classic.yaml    |  2 +-
 gremlin-server/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 +-
 .../conf/gremlin-server-rest-modern.yaml           |  2 +-
 .../conf/gremlin-server-rest-secure.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 +-
 .../apache/tinkerpop/gremlin/server/Settings.java  | 18 +++++-
 .../gremlin/server/op/AbstractEvalOpProcessor.java | 12 ++--
 .../gremlin/server/op/session/Session.java         |  2 +-
 .../server/op/traversal/TraversalOpProcessor.java  | 15 +++--
 .../gremlin/server/util/ServerGremlinExecutor.java |  4 +-
 .../AbstractGremlinServerIntegrationTest.java      |  8 +--
 .../gremlin/server/GremlinDriverIntegrateTest.java |  6 +-
 .../gremlin/server/GremlinServerIntegrateTest.java | 57 +++++++++++++++--
 .../server/GremlinServerSessionIntegrateTest.java  |  2 +-
 .../gremlin/server/gremlin-server-integration.yaml |  2 +-
 32 files changed, 260 insertions(+), 68 deletions(-)

diff --cc docs/src/reference/gremlin-applications.asciidoc
index 90757ef,e07407d..9020fc8
--- a/docs/src/reference/gremlin-applications.asciidoc
+++ b/docs/src/reference/gremlin-applications.asciidoc
@@@ -1006,8 -1011,8 +1006,8 @@@ The following table describes the vario
  |scriptEngines.<name>.staticImports |A comma separated list of "static" imports to make available to the `ScriptEngine`. |_none_
  |scriptEngines.<name>.scripts |A comma separated list of script files to execute on `ScriptEngine` initialization. `Graph` and `TraversalSource` instance references produced from scripts will be stored globally in Gremlin Server, therefore it is possible to use initialization scripts to add Traversal Strategies or create entirely new `Graph` instances all together. Instantiating a `LifeCycleHook` in a script provides a way to execute scripts when Gremlin Server starts and stops.|_none_
  |scriptEngines.<name>.config |A `Map` of configuration settings for the `ScriptEngine`.  These settings are dependent on the `ScriptEngine` implementation being used. |_none_
- |scriptEvaluationTimeout |The amount of time in milliseconds before a script evaluation and iteration of result times out. This feature can be turned off by setting the value to `0`. |30000
 -|evaluationTimeout |The amount of time in milliseconds before a script evaluation and iteration of result times out. This feature can be turned off by setting the value to `0`. |30000
 -|serializers |A `List` of `Map` settings, where each `Map` represents a `MessageSerializer` implementation to use along with its configuration. If this value is not set, then Gremlin Server will configure with GraphSON and Gryo but will not register any `ioRegistries` for configured graphs. |_empty_
++|evaluationTimeout |The amount of time in milliseconds before a request evaluation and iteration of result times out. This feature can be turned off by setting the value to `0`. |30000
 +|serializers |A `List` of `Map` settings, where each `Map` represents a `MessageSerializer` implementation to use along with its configuration. If this value is not set, then Gremlin Server will configure with GraphSON and GraphBinary but will not register any `ioRegistries` for configured graphs. |_empty_
  |serializers[X].className |The full class name of the `MessageSerializer` implementation. |_none_
  |serializers[X].config |A `Map` containing `MessageSerializer` specific configurations. |_none_
  |ssl.enabled |Determines if SSL is turned on or not. |false