Skip to content

Hotfix for unwind and merge & broken iterator, fixes #2856#2861

Merged
robfrank merged 5 commits intoArcadeData:mainfrom
ExtReMLapin:fix_merge_unwind
Dec 9, 2025
Merged

Hotfix for unwind and merge & broken iterator, fixes #2856#2861
robfrank merged 5 commits intoArcadeData:mainfrom
ExtReMLapin:fix_merge_unwind

Conversation

@ExtReMLapin
Copy link
Contributor

What does this PR do?

fixes #2856

Motivation

What inspired you to submit this pull request?

Something something iterator exhausted, gremlin specific bug.

Related issues

#2856

Additional Notes

Gemini did all the work

No bandwidth to read the whole code myself

No bandwidth to write tests

Checklist

  • I have run the build using mvn clean package command
  • My unit tests cover both failure and success scenarios (no bandwidth to write tests, feel free to contribute to this PR)

Failing tests :

image image image

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @ExtReMLapin, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request provides a hotfix for a persistent 'iterator exhausted' bug encountered during Gremlin operations, specifically when dealing with unwind and merge functionalities, and filtering by index or type. The core issue stemmed from iterators being consumed and not re-initialized, leading to incorrect or incomplete results. The changes ensure that a fresh iterator is provided whenever requested, resolving the underlying state management problem and improving the reliability of Gremlin queries.

Highlights

  • Iterator Exhaustion Fix: Addresses a critical 'iterator exhausted' bug impacting Gremlin operations, particularly with unwind and merge commands, by ensuring iterators are properly reset.
  • Gremlin Step Refactoring: Refactors the ArcadeFilterByIndexStep and ArcadeFilterByTypeStep classes to correctly initialize rawIterator within the iteratorSupplier lambda, preventing stale iterator states.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@ExtReMLapin
Copy link
Contributor Author

Compiled at home on windows, not sure if precommit did the job correctly

@mergify
Copy link
Contributor

mergify bot commented Dec 4, 2025

🧪 CI Insights

Here's what we observed from your CI run for 71880b8.

🟢 All jobs passed!

But CI Insights is watching 👀

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request correctly fixes an iterator exhaustion bug by ensuring a new iterator is created on each call to the supplier. The changes in ArcadeFilterByIndexStep and ArcadeFilterByTypeStep are logical and address the described issue.

I've added one comment regarding code duplication in ArcadeFilterByTypeStep.java which could be addressed in a follow-up to improve maintainability.

Given this is a hotfix, it would be highly beneficial to add a regression test that reproduces the original bug. This would ensure the fix is effective and prevent future regressions, especially since the PR description notes a lack of bandwidth for testing.

@lvca lvca added the bug label Dec 8, 2025
@lvca lvca added this to the 25.11.1 milestone Dec 8, 2025
@robfrank robfrank merged commit 7502cd6 into ArcadeData:main Dec 9, 2025
2 of 4 checks passed
@robfrank
Copy link
Collaborator

robfrank commented Dec 9, 2025

thanks, merged

@ExtReMLapin
Copy link
Contributor Author

Hooray !

robfrank added a commit that referenced this pull request Feb 11, 2026
Co-authored-by: Pierre F <no@p.e>
Co-authored-by: Roberto Franchini <ro.franchini@gmail.com>
(cherry picked from commit 7502cd6)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Cypher] Batch and MERGE doesn't return all entries when they all exist, just the first one

3 participants