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

RethinkDB code might ignore write errors #292

Open
TheTechRobo opened this issue Oct 5, 2024 · 0 comments
Open

RethinkDB code might ignore write errors #292

TheTechRobo opened this issue Oct 5, 2024 · 0 comments

Comments

@TheTechRobo
Copy link

TheTechRobo commented Oct 5, 2024

I've been looking at brozzler's codebase and I see a lot of direct writes to RethinkDB (e.g. https://github.com/internetarchive/brozzler/blob/master/brozzler/model.py#L119). That would be fine, but RethinkDB has weird behaviour regarding errors: https://rethinkdb.com/api/python/insert/

Basically, if an error occurs, RethinkDB will only throw an exception if it's unrelated to writes (e.g. the query is malformed). If there's an I/O error, the 'errors' field in the return value will be greater than 0, but no exception will be raised.

It's an awful default IMO, and there's an open issue about it in RethinkDB's repository (rethinkdb/rethinkdb#3440). My concern is that it might be possible for a write to not go through and brozzler wouldn't know. Is there protection against this in the codebase?

Brozzler seems to use a custom RethinkDB wrapper (doublethink), but I don't see any checks on the errors field. Some of the code in Brozzler does check the inserted and replaced fields, but not all of it.

If I'm wrong about this, please let me know!

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

No branches or pull requests

1 participant