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 2021/12/23 11:00:14 UTC

[tinkerpop] branch ci-fix updated (f5ad029 -> 6a9b4ab)

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

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


    from f5ad029  Go back to older netty - 4.1.68
     new cf95bc0  Bump back to netty 4.1.72
     new 6a9b4ab  Revert "TINKERPOP-2626 Prevent premature close of traversal"

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                                                    | 1 -
 .../gremlin/process/traversal/step/filter/RangeGlobalStep.java        | 3 +++
 .../tinkerpop/gremlin/process/traversal/util/DefaultTraversal.java    | 4 +---
 .../apache/tinkerpop/gremlin/structure/util/CloseableIterator.java    | 3 ++-
 pom.xml                                                               | 2 +-
 5 files changed, 7 insertions(+), 6 deletions(-)

[tinkerpop] 01/02: Bump back to netty 4.1.72

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

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

commit cf95bc0989c323388dae799c741b414f3d86968f
Author: Stephen Mallette <st...@amazon.com>
AuthorDate: Thu Dec 23 05:58:52 2021 -0500

    Bump back to netty 4.1.72
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index b2ad55f..5503889 100644
--- a/pom.xml
+++ b/pom.xml
@@ -156,7 +156,7 @@ limitations under the License.
         <jcabi.version>1.1</jcabi.version>
         <log4j.version>1.2.17</log4j.version>
         <metrics.version>3.0.2</metrics.version>
-        <netty.version>4.1.68.Final</netty.version>
+        <netty.version>4.1.72.Final</netty.version>
         <slf4j.version>1.7.25</slf4j.version>
         <snakeyaml.version>1.27</snakeyaml.version>
         <spark.version>2.4.0</spark.version>

[tinkerpop] 02/02: Revert "TINKERPOP-2626 Prevent premature close of traversal"

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

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

commit 6a9b4abb3d02da08d548be1ef5ee02ec7bebcb3e
Author: Stephen Mallette <st...@amazon.com>
AuthorDate: Thu Dec 23 05:59:45 2021 -0500

    Revert "TINKERPOP-2626 Prevent premature close of traversal"
    
    This reverts commit 96ccc21a8dc3134c4a5148bf1ada855ec7a79a4e.
---
 CHANGELOG.asciidoc                                                    | 1 -
 .../gremlin/process/traversal/step/filter/RangeGlobalStep.java        | 3 +++
 .../tinkerpop/gremlin/process/traversal/util/DefaultTraversal.java    | 4 +---
 .../apache/tinkerpop/gremlin/structure/util/CloseableIterator.java    | 3 ++-
 4 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc
index ed87ae9..dd2f55c 100644
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@ -23,7 +23,6 @@ image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/ima
 [[release-3-4-13]]
 === TinkerPop 3.4.13 (Release Date: NOT OFFICIALLY RELEASED YET)
 
-* Fixed `RangeGlobalStep` which was prematurely closing the iterator.
 * Prevented XML External Entity (XXE) style attacks via `GraphMLReader` by disabling DTD and external entities by default.
 * Improved error message for failed serialization for HTTP-based requests.
 * Fixed a `NullPointerException` that could occur during a failed `Connection` initialization due to uninstantiated `AtomicInteger`.
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/RangeGlobalStep.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/RangeGlobalStep.java
index 9824332..37441eb 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/RangeGlobalStep.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/RangeGlobalStep.java
@@ -63,6 +63,9 @@ public final class RangeGlobalStep<S> extends FilterStep<S> implements Ranging,
         if (this.bypass) return true;
 
         if (this.high != -1 && this.counter.get() >= this.high) {
+            // This is a global step and this place would be the end of the traversal.
+            // Close the traversal to free up resources.
+            CloseableIterator.closeIterator(traversal);
             throw FastNoSuchElementException.instance();
         }
 
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/DefaultTraversal.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/DefaultTraversal.java
index 3aa7bc1..cd3b7c4 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/DefaultTraversal.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/DefaultTraversal.java
@@ -193,9 +193,7 @@ public class DefaultTraversal<S, E> implements Traversal.Admin<S, E> {
     @Override
     public boolean hasNext() {
         if (!this.locked) this.applyStrategies();
-        final boolean more = this.lastTraverser.bulk() > 0L || this.finalEndStep.hasNext();
-        if (!more) CloseableIterator.closeIterator(this);
-        return more;
+        return this.lastTraverser.bulk() > 0L || this.finalEndStep.hasNext();
     }
 
     @Override
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/CloseableIterator.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/CloseableIterator.java
index 5c33f8d..2464d11 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/CloseableIterator.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/util/CloseableIterator.java
@@ -51,7 +51,8 @@ public interface CloseableIterator<T> extends Iterator<T>, Closeable {
         if (iterator instanceof AutoCloseable) {
             try {
                 ((AutoCloseable) iterator).close();
-            } catch (Exception e) {
+            }
+            catch (Exception e) {
                 throw new RuntimeException(e);
             }
         }