You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by "Cole-Greer (via GitHub)" <gi...@apache.org> on 2026/10/01 18:08:40 UTC

Re: [PR] TINKERPOP-3283: loops() quietly overflows [tinkerpop]

Cole-Greer commented on PR #3688:
URL: https://github.com/apache/tinkerpop/pull/3688#issuecomment-5937520996

   > Thanks for fixing this issue, the code changes here look good to me. I think there is value in adding some quick extra docs and tests for this as well. Could you add a quick note in the `considerations` and `exceptions` sections of the [repeat semantics docs](https://github.com/apache/tinkerpop/blob/11cc6bfb512451ccca76a872076df0fdcbd01bd2/docs/src/dev/provider/gremlin-semantics.asciidoc?plain=1#L1421) explaining the iteration cap and exception?
   > 
   > Additionally, I think it would be good to add some trivial scenarios to [repeat.feature](https://github.com/apache/tinkerpop/blob/3.7-dev/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/test/features/branch/Repeat.feature) which enforce these semantics. Something like these should do it:
   > 
   > ```
   > g.V(1).repeat(loops()).times(Integer.MAX_VALUE)
   > ==> Integer.MAX_VALUE-1
   > 
   > g.V(1).repeat(loops()).times(Integer.MAX_VALUE+1)
   > ==> Exception
   > ```
   > 
   > There's already a few examples of how to assert exceptions in repeat.feature which you can copy from.
   
   If these tests are too slow, it's probably good enough to just confirm the loops counter can exceed short max:
   
   ```
   g.V(1).repeat(loops()).times(100000)
   ==> 99999
   ```


-- 
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