You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by GitBox <gi...@apache.org> on 2021/11/24 16:13:47 UTC

[GitHub] [tinkerpop] spmallette commented on a change in pull request #1502: TINKERPOP-2626 Prevent premature close of traversal

spmallette commented on a change in pull request #1502:
URL: https://github.com/apache/tinkerpop/pull/1502#discussion_r756232393



##########
File path: gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/DefaultTraversal.java
##########
@@ -193,7 +193,9 @@ public void applyStrategies() throws IllegalStateException {
     @Override
     public boolean hasNext() {
         if (!this.locked) this.applyStrategies();
-        return this.lastTraverser.bulk() > 0L || this.finalEndStep.hasNext();
+        final boolean more = this.lastTraverser.bulk() > 0L || this.finalEndStep.hasNext();
+        if (!more) CloseableIterator.closeIterator(this);

Review comment:
       the other terminal steps tend to call `fill()` which performs a close properly.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tinkerpop.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org