vaidikgarg-bit opened a new pull request, #3437:
URL: https://github.com/apache/hugegraph/pull/3437
## Purpose of the PR
- close #3436
`MultiListIterator.close()` closes `innerIterator` and whatever remains in
`innerListIterator`. Both fields are set on the first `hasNext()` or
`isValid()` call, so an iterator closed before that has `null` in both. In that
case `close()` skips both and clears the list, and none of the sub-iterators
gets closed. `AggregativeQueryObserver` runs into this when a query is
cancelled after `getIterator()` returns but before its read loop calls
`hasNext()`. The scan iterators `BusinessHandlerImpl` already opened for the
query are then left open.
## Main Changes
- `close()` starts `innerListIterator` from the full list when iteration
never began, so the existing loop closes every sub-iterator. When iteration has
started, it keeps its current behavior: sub-iterators that were exhausted and
closed are not closed again.
- `FilterIteratorContractTest` gains three tests. One closes a bare
`MultiListIterator` before iteration and then closes it again, one closes it
through the limit-dedup wrapper `MapLimitIterator`, and one closes it partway
through. In each, every sub-iterator must be closed exactly once.
## Verifying these changes
- [ ] Trivial rework / code cleanup without any test coverage. (No Need)
- [ ] Already covered by existing tests, such as *(please modify tests
here)*.
- [x] Need tests and can be verified as follows:
- on master the two close-before-iteration tests fail, since the
sub-iterators are never closed; the partial-iteration test passes on master too
and guards against double closing
- `store-server-test` (192), `store-core-test` and `store-rocksdb-test`
(19) pass locally, and `mvn editorconfig:check` reports nothing in tracked files
## Does this PR potentially affect the following parts?
- [ ] Dependencies ([add/update
license](https://hugegraph.apache.org/docs/contribution-guidelines/contribute/#321-check-licenses)
info &
[regenerate_known_dependencies.sh](../install-dist/scripts/dependency/regenerate_known_dependencies.sh))
- [ ] Modify configurations
- [ ] The public API
- [ ] Other affects (typed here)
- [x] Nope
## Documentation Status
- [ ] `Doc - TODO`: required documentation is pending; complete it before
merging.
- [ ] `Doc - Done`: documentation is included here or linked below.
- [x] `Doc - No Need`: no user-visible documentation is affected.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]