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/11/14 00:08:42 UTC

[tinkerpop] branch travis-fix updated (c11c899 -> 106b896)

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

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


 discard c11c899  Increase time willing to wait for a connection
 discard dc8a87b  Remove sleep() from test to see if that makes a difference
 discard 9269cf6  try-catch-finally to better handle Cluster.close() in tests
 discard f9327f6  test if waiting helps close connections
 discard aa6d5cf  Make the first request in a synchronous fashion
 discard 91e8db2  Cleanup travis logs a bit by increasing compilation time.
 discard 9aa0692  Prevent a null pointer when session kill futuer is not present CTR
     new 4dadccb  A body of commits to debug/fix a failing travis test
     new 106b896  Increase default max wait time for a connection with java driver

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (c11c899)
            \
             N -- N -- N   refs/heads/travis-fix (106b896)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

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:
 .../main/java/org/apache/tinkerpop/gremlin/driver/Connection.java   | 2 +-
 .../tinkerpop/gremlin/server/GremlinServerSessionIntegrateTest.java | 6 ------
 2 files changed, 1 insertion(+), 7 deletions(-)


[tinkerpop] 02/02: Increase default max wait time for a connection with java driver

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

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

commit 106b896c65879c0afb8924c6600896d829ef2ebf
Author: stephen <sp...@gmail.com>
AuthorDate: Wed Nov 13 19:07:44 2019 -0500

    Increase default max wait time for a connection with java driver
    
    Cleaned up some dead log messages from debugging
---
 .../main/java/org/apache/tinkerpop/gremlin/driver/Connection.java   | 2 +-
 .../tinkerpop/gremlin/server/GremlinServerSessionIntegrateTest.java | 6 ------
 2 files changed, 1 insertion(+), 7 deletions(-)

diff --git a/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Connection.java b/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Connection.java
index e700d49..aa0868f 100644
--- a/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Connection.java
+++ b/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/Connection.java
@@ -61,7 +61,7 @@ final class Connection {
 
     public static final int MAX_IN_PROCESS = 4;
     public static final int MIN_IN_PROCESS = 1;
-    public static final int MAX_WAIT_FOR_CONNECTION = 3000;
+    public static final int MAX_WAIT_FOR_CONNECTION = 16000;
     public static final int MAX_WAIT_FOR_SESSION_CLOSE = 3000;
     public static final int MAX_CONTENT_LENGTH = 65536;
 
diff --git a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerSessionIntegrateTest.java b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerSessionIntegrateTest.java
index 889228c..9a3e4ff 100644
--- a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerSessionIntegrateTest.java
+++ b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerSessionIntegrateTest.java
@@ -343,10 +343,8 @@ public class GremlinServerSessionIntegrateTest  extends AbstractGremlinServerInt
                 }
             });
 
-            System.out.println("shouldEnsureSessionBindingsAreThreadSafe: sent 10000");
             assertEquals(requests, futures.size());
 
-            System.out.println("shouldEnsureSessionBindingsAreThreadSafe: asserting 10000");
             int counter = 0;
             for (CompletableFuture<ResultSet> f : futures) {
                 final Result r = f.get().all().get(30000, TimeUnit.MILLISECONDS).get(0);
@@ -355,14 +353,10 @@ public class GremlinServerSessionIntegrateTest  extends AbstractGremlinServerInt
             }
 
             assertEquals(requests, counter);
-            System.out.println("shouldEnsureSessionBindingsAreThreadSafe: asserted 10000");
-
         } catch (Exception ex) {
             fail(ex.getMessage());
         } finally {
-            System.out.println("shouldEnsureSessionBindingsAreThreadSafe: calling cluster.close");
             cluster.close();
-            System.out.println("shouldEnsureSessionBindingsAreThreadSafe: called cluster.close");
         }
 
     }


[tinkerpop] 01/02: A body of commits to debug/fix a failing travis test

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

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

commit 4dadccb0e5dae5bee0f8117dd15452b1bd5560c5
Author: stephen <sp...@gmail.com>
AuthorDate: Mon Nov 11 08:23:31 2019 -0500

    A body of commits to debug/fix a failing travis test
    
    Prevent a null pointer when session kill futuer is not present CTR
    
    Cleanup travis logs a bit by increasing compilation time.
    
    Noticed the logs were filled with WARN messages about init scripts taking longer than the default time of 5 seconds to compile. Must just be slower on Travis as we don't see this elsewhere.
    
    Make the first request in a synchronous fashion
    
    test if waiting helps close connections
    
    try-catch-finally to better handle Cluster.close() in tests
    
    Remove sleep() from test to see if that makes a difference
    
    Increase time willing to wait for a connection
---
 .../gremlin-server-integration-secure.yaml         |  1 +
 .../gremlin-server/gremlin-server-integration.yaml |  1 +
 .../gremlin/server/op/session/Session.java         |  8 +++-
 .../server/op/session/SessionOpProcessor.java      |  1 -
 .../server/GremlinServerSessionIntegrateTest.java  | 50 ++++++++++++++--------
 .../gremlin/server/gremlin-server-integration.yaml |  1 +
 6 files changed, 41 insertions(+), 21 deletions(-)

diff --git a/docker/gremlin-server/gremlin-server-integration-secure.yaml b/docker/gremlin-server/gremlin-server-integration-secure.yaml
index 2274852..c489e07 100644
--- a/docker/gremlin-server/gremlin-server-integration-secure.yaml
+++ b/docker/gremlin-server/gremlin-server-integration-secure.yaml
@@ -29,6 +29,7 @@ scriptEngines: {
   gremlin-groovy: {
     plugins: { org.apache.tinkerpop.gremlin.server.jsr223.GremlinServerGremlinPlugin: {},
                org.apache.tinkerpop.gremlin.tinkergraph.jsr223.TinkerGraphGremlinPlugin: {},
+               org.apache.tinkerpop.gremlin.groovy.jsr223.GroovyCompilerGremlinPlugin: {expectedCompilationTime: 30000},
                org.apache.tinkerpop.gremlin.jsr223.ImportGremlinPlugin: {classImports: [java.lang.Math], methodImports: [java.lang.Math#*]},
                org.apache.tinkerpop.gremlin.jsr223.ScriptFileGremlinPlugin: {files: [scripts/generate-all.groovy]}}},
   gremlin-jython: {},
diff --git a/docker/gremlin-server/gremlin-server-integration.yaml b/docker/gremlin-server/gremlin-server-integration.yaml
index 4ccaf32..7c5445a 100644
--- a/docker/gremlin-server/gremlin-server-integration.yaml
+++ b/docker/gremlin-server/gremlin-server-integration.yaml
@@ -29,6 +29,7 @@ scriptEngines: {
   gremlin-groovy: {
     plugins: { org.apache.tinkerpop.gremlin.server.jsr223.GremlinServerGremlinPlugin: {},
                org.apache.tinkerpop.gremlin.tinkergraph.jsr223.TinkerGraphGremlinPlugin: {},
+               org.apache.tinkerpop.gremlin.groovy.jsr223.GroovyCompilerGremlinPlugin: {expectedCompilationTime: 30000},
                org.apache.tinkerpop.gremlin.jsr223.ImportGremlinPlugin: {classImports: [java.lang.Math], methodImports: [java.lang.Math#*]},
                org.apache.tinkerpop.gremlin.jsr223.ScriptFileGremlinPlugin: {files: [scripts/generate-all.groovy]}}},
   gremlin-jython: {},
diff --git a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/op/session/Session.java b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/op/session/Session.java
index f41a0fb..7191d04 100644
--- a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/op/session/Session.java
+++ b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/op/session/Session.java
@@ -34,6 +34,7 @@ import javax.script.Bindings;
 import javax.script.SimpleBindings;
 import java.util.HashMap;
 import java.util.Map;
+import java.util.Optional;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
@@ -155,7 +156,12 @@ public class Session {
      * session kill will mean.
      */
     public void manualKill(final boolean force) {
-        kill.get().cancel(true);
+        // seems there is a situation where kill can get nulled. seems to only happen in travis as a result of test
+        // runs and i'm guessing it has something to do with a combination of shutdown and session close though i'm
+        // not sure why. perhaps this "fix" just masks up a deeper problem but as i reason on it now, it seems mostly
+        // bound to shutdown situations which basically means the forced end of the session anyway, so perhaps the
+        // root cause isn't something that needs immediate chasing (at least until it can be shown otherwise anyway)
+        Optional.ofNullable(kill.get()).ifPresent(f -> f.cancel(true));
         kill(force);
     }
 
diff --git a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/op/session/SessionOpProcessor.java b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/op/session/SessionOpProcessor.java
index 54a409b..545ae7e 100644
--- a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/op/session/SessionOpProcessor.java
+++ b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/op/session/SessionOpProcessor.java
@@ -124,7 +124,6 @@ public class SessionOpProcessor extends AbstractEvalOpProcessor {
     /**
      * Session based requests accept a "close" operator in addition to "eval". A close will trigger the session to be
      * killed and any uncommitted transaction to be rolled-back.
-     * @return
      */
     @Override
     public Optional<ThrowingConsumer<Context>> selectOther(final RequestMessage requestMessage) throws OpProcessorException {
diff --git a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerSessionIntegrateTest.java b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerSessionIntegrateTest.java
index 07944e8..889228c 100644
--- a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerSessionIntegrateTest.java
+++ b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerSessionIntegrateTest.java
@@ -327,32 +327,44 @@ public class GremlinServerSessionIntegrateTest  extends AbstractGremlinServerInt
 
     @Test
     public void shouldEnsureSessionBindingsAreThreadSafe() throws Exception {
-        final Cluster cluster = TestClientFactory.build().minInProcessPerConnection(16).maxInProcessPerConnection(64).create();
+        final Cluster cluster = TestClientFactory.build().maxWaitForConnection(90000).
+                minInProcessPerConnection(16).maxInProcessPerConnection(64).create();
         final Client client = cluster.connect(name.getMethodName());
 
-        client.submitAsync("a=100;b=1000;c=10000;null");
-        final int requests = 10000;
-        final List<CompletableFuture<ResultSet>> futures = new ArrayList<>(requests);
-        IntStream.range(0, requests).forEach(i -> {
-            try {
-                futures.add(client.submitAsync("a+b+c"));
-            } catch (Exception ex) {
-                throw new RuntimeException(ex);
+        try {
+            client.submit("a=100;b=1000;c=10000;null").all().get();
+            final int requests = 10000;
+            final List<CompletableFuture<ResultSet>> futures = new ArrayList<>(requests);
+            IntStream.range(0, requests).forEach(i -> {
+                try {
+                    futures.add(client.submitAsync("a+b+c"));
+                } catch (Exception ex) {
+                    throw new RuntimeException(ex);
+                }
+            });
+
+            System.out.println("shouldEnsureSessionBindingsAreThreadSafe: sent 10000");
+            assertEquals(requests, futures.size());
+
+            System.out.println("shouldEnsureSessionBindingsAreThreadSafe: asserting 10000");
+            int counter = 0;
+            for (CompletableFuture<ResultSet> f : futures) {
+                final Result r = f.get().all().get(30000, TimeUnit.MILLISECONDS).get(0);
+                assertEquals(11100, r.getInt());
+                counter++;
             }
-        });
 
-        assertEquals(requests, futures.size());
+            assertEquals(requests, counter);
+            System.out.println("shouldEnsureSessionBindingsAreThreadSafe: asserted 10000");
 
-        int counter = 0;
-        for(CompletableFuture<ResultSet> f : futures) {
-            final Result r = f.get().all().get(30000, TimeUnit.MILLISECONDS).get(0);
-            assertEquals(11100, r.getInt());
-            counter++;
+        } catch (Exception ex) {
+            fail(ex.getMessage());
+        } finally {
+            System.out.println("shouldEnsureSessionBindingsAreThreadSafe: calling cluster.close");
+            cluster.close();
+            System.out.println("shouldEnsureSessionBindingsAreThreadSafe: called cluster.close");
         }
 
-        assertEquals(requests, counter);
-
-        cluster.close();
     }
 
     @Test
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 adf05cd..601e404 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
@@ -42,6 +42,7 @@ scriptEngines: {
   gremlin-groovy: {
     plugins: { org.apache.tinkerpop.gremlin.server.jsr223.GremlinServerGremlinPlugin: {},
                org.apache.tinkerpop.gremlin.tinkergraph.jsr223.TinkerGraphGremlinPlugin: {},
+               org.apache.tinkerpop.gremlin.groovy.jsr223.GroovyCompilerGremlinPlugin: {expectedCompilationTime: 30000},
                org.apache.tinkerpop.gremlin.jsr223.ImportGremlinPlugin: {classImports: [java.lang.Math], methodImports: [java.lang.Math#*]},
                org.apache.tinkerpop.gremlin.jsr223.ScriptFileGremlinPlugin: {files: [scripts/generate-all.groovy]}}}}
 serializers: