Skip to content
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

ReqlDriverError: query cancelled #124

Open
apeman76 opened this issue Dec 5, 2023 · 4 comments
Open

ReqlDriverError: query cancelled #124

apeman76 opened this issue Dec 5, 2023 · 4 comments
Labels
bug Something isn't working

Comments

@apeman76
Copy link

apeman76 commented Dec 5, 2023

I am having the same issue as
#8

I am closing the cursor of a changefeed using a connectPool

        // Connection pool options
        const options = {
            silent: true,
            host: "localhost",
            port: 28015,
            db: "mydb",
            buffer: 50,
        };

        await r.connectPool(options);
        console.log("RethinkDB connection pool established");

Then I create the cursor:

        cursor = await r.table("settings").get(userId).changes(changeOptions).run();

        cursor.each((err, change) => {
            if (err) {
                console.error(err);
                return;
            }
            if (change) {
                try {
                    emit("settings", JSON.stringify(change));
                } catch (e) {
                    console.error("Error emitting data:", e);
                }
            }
        });

and when I try to .close() it, it will produce the error:

RethinkDBError [ReqlDriverError]: Query cancelled in:
r.db("mydb").table("settings").get(

As you can see im already using silent as suggested in #8 but it still appears
I have also tried
log: (message: string) => {},

Changing
https://github.com/rethinkdb/rethinkdb-ts/blob/9b9810dfb9a09283e0ab57d84edd631d2d936f53/src/connection/socket.ts#L182C18-L182C18
This line to if (data?.queue.length > 0) { does seem to solve the issue, but im no expert and this might be plain wrong.

Thanks in advance!

@apeman76 apeman76 added the bug Something isn't working label Dec 5, 2023
@atassis
Copy link
Collaborator

atassis commented Dec 13, 2023

Does this code break an execution or it just logs this error out without breaking anything? There are some places in the library, which are logging an error without depending in the log function. I wanted to change that in v3 version of the lib, but have no time to proper test it and make a broad full changelog.

@apeman76
Copy link
Author

Does this code break an execution or it just logs this error out without breaking anything? There are some places in the library, which are logging an error without depending in the log function. I wanted to change that in v3 version of the lib, but have no time to proper test it and make a broad full changelog.

It just logs the error, it doesn't seem to break anything

@atassis
Copy link
Collaborator

atassis commented Dec 16, 2023

Ok, I thought so. Lib might just output an error caught internally. Does the fact it outputs bother you much?

@apeman76
Copy link
Author

Ok, I thought so. Lib might just output an error caught internally. Does the fact it outputs bother you much?

Its not really a issue but if there was a quick fix to silence this specific error i'd take it :)
i.e. if the if (data?.queue.length > 0) { doesnt break anything i'll leave that in for now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants