Skip to content

Synchronous streaming batched cursor throws exception when attempting to close after last batch is consumed #528

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
philipp-birkl opened this issue Dec 1, 2023 · 1 comment
Assignees
Labels

Comments

@philipp-birkl
Copy link

An com.arangodb.ArangoDBException is thrown when trying to close a streaming batched cursor.

Such as

        try(ArangoCursor<Map> cursor = db.query("FOR el in collection RETURN el",
            Map.class,
            new AqlQueryOptions()
                .ttl(3600)
                .batchSize(2)
                .stream(true))) {

            while(cursor.hasNext()) {
                log.info("{}", cursor.next());
            }
        } catch (IOException e) {
            throw new RuntimeException(e);
        }

This code throws an error when closing the cursor after the try-with-resources block is finished.

com.arangodb.ArangoDBException: Response: 404, Error: 1600 - cursor not found
	at com.arangodb.ArangoDBException.of(ArangoDBException.java:137)
	at com.arangodb.ArangoDBException.of(ArangoDBException.java:111)
	at com.arangodb.ArangoDBException.of(ArangoDBException.java:107)
	at com.arangodb.internal.net.CommunicationProtocol.execute(CommunicationProtocol.java:43)
	at com.arangodb.internal.ArangoExecutorSync.execute(ArangoExecutorSync.java:55)
	at com.arangodb.internal.ArangoExecutorSync.execute(ArangoExecutorSync.java:43)
	at com.arangodb.internal.ArangoDatabaseImpl$1.close(ArangoDatabaseImpl.java:216)
	at com.arangodb.internal.cursor.ArangoCursorImpl.close(ArangoCursorImpl.java:60)
Product Version
Spring Boot 3.2.0
ArangoDB 3.11
Arango Java Driver 7.3.0
@philipp-birkl philipp-birkl changed the title Synchronous streaming batched cursor throws exception when attemting to close after last batch is consumed Synchronous streaming batched cursor throws exception when atemting to close after last batch is consumed Dec 1, 2023
@philipp-birkl philipp-birkl changed the title Synchronous streaming batched cursor throws exception when atemting to close after last batch is consumed Synchronous streaming batched cursor throws exception when attempting to close after last batch is consumed Dec 1, 2023
@rashtao rashtao self-assigned this Dec 1, 2023
@rashtao rashtao added the bug label Dec 4, 2023
rashtao added a commit that referenced this issue Dec 19, 2023
@rashtao
Copy link
Collaborator

rashtao commented Dec 20, 2023

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants