You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by ly...@apache.org on 2023/06/20 22:23:25 UTC

[tinkerpop] 01/01: Merge remote-tracking branch 'origin/3.6-dev'

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

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

commit 006f96400fe9da35e34f1d04cd53af89605d0b4a
Merge: 8d107c3dcc 36be1a376d
Author: lyndon <ly...@apache.org>
AuthorDate: Tue Jun 20 15:23:14 2023 -0700

    Merge remote-tracking branch 'origin/3.6-dev'

 CHANGELOG.asciidoc                                 |  1 +
 .../apache/tinkerpop/gremlin/server/Context.java   | 23 ++++++++++++++++++++++
 .../server/op/session/SessionOpProcessor.java      | 13 ++++++++++--
 .../server/op/traversal/TraversalOpProcessor.java  | 13 ++++++++++--
 4 files changed, 46 insertions(+), 4 deletions(-)

diff --cc gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/Context.java
index 720c4d9862,befebb45aa..8636954ad5
--- a/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/Context.java
+++ b/gremlin-server/src/main/java/org/apache/tinkerpop/gremlin/server/Context.java
@@@ -95,9 -94,27 +99,28 @@@ public class Context 
          this.gremlinArgument = requestMessage.getArgs().get(Tokens.ARGS_GREMLIN);
          this.requestContentType = determineRequestContents();
          this.requestTimeout = determineTimeout();
 +        this.materializeProperties = determineMaterializeProperties();
      }
  
+     public void setTimeoutExecutor(final ScheduledFuture<?> timeoutExecutor) {
+         synchronized (timeoutExecutorLock) {
+             this.timeoutExecutor = timeoutExecutor;
+ 
+             // Timeout was grabbed before we got here, this means the query executed before the timeout was created.
+             if (timeoutExecutorGrabbed) {
+                 // Cancel the timeout.
+                 this.timeoutExecutor.cancel(true);
+             }
+         }
+     }
+ 
+     public ScheduledFuture<?> getTimeoutExecutor() {
+         synchronized (timeoutExecutorLock) {
+             timeoutExecutorGrabbed = true;
+             return this.timeoutExecutor;
+         }
+     }
+ 
      /**
       * The timeout for the request. If the request is a script it examines the script for a timeout setting using
       * {@code with()}. If that is not found then it examines the request itself to see if the timeout is provided by