-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Check whether it's ok for the Python and Java driver to ignore the response to STOP requests #6014
Comments
Continuing the conversation from 9151114#commitcomment-18451665 Do you have some example codes that show how to handle I'm guessing it works something like:
|
@bchavez Yeah, basically just check if the response is an error response, and if it is, throw that error (or log it somewhere, or whatever makes sense). |
In my experience, unknown token errors should often be ignored. If the server sends a |
@AtnNn Ok that makes sense. I didn't think of that case. |
Proper thread-safe implementation with thread signaling constructs.
Lighter touch on processing cursor STOP messages.
Lighter touch on processing cursor STOP messages.
Lighter touch on processing cursor STOP messages.
So, I tried to implement this in the C# driver and here's what happened. There are two actions I thought were most reasonable to handle: Act 1 - Two Threads - One Reader, One Closer
Act 2 - One Thread - Aborted Read, then Close
Solution 1My first thought for Act 1 was any call to I did it, but it's not pretty... so, bit more thinking on it.... Solution 2I thought of another solution that used an interlocking mechanism that doesn't need OS semaphore primitives for cross-thread communication. I like it since it keeps cursor objects lightweight. Ye, simple object locking is pretty much handled by the CLR runtime using a But one burning question remains... in Solution 2 is how am I going to know if I'm in Act 1 or Act 2. It's possible I'm in Act 1, but Thread A goes off and does something and maybe never comes back to processes the last One way I'm thinking to discriminate between Act 1 and Act 2 is by asking the user when calling Solution 2.5Use some kind of atomic interlocked counter to deflect any I just dunno. Perhaps I just need to get past the OCD, bite the bullet, and use a Come to think of it... starting to wonder, I haven't had a bug in the cursor code since February'16 when I rewrote it... my .NET peeps seem happy. If it ain't broke, why fix it? 💨 🚶 _"Bubbles of gas in my brain... Send me off balance, it's not enough"_ |
@bchavez I'm now tending towards ignoring the In some simpler drivers (like the PHP driver), handling the |
The Java driver currently have a PR (rethinkdb/rethinkdb-java#12) that rewrote the way Cursors work (by removing them and replacing them with reactive streams), and still had no use to the response of the |
The Python and Java drivers currently ignore the server's response to a STOP request on a cursor.
I'm not sure how the JS and Ruby drivers handle this.
Ignoring the response could hide some real issues.
If for example a bug in the driver or server caused the wrong token to be sent, the server would respond with an error that the token is unknown. However the client would ignore the error. As a consequence, cursors might never get closed, and will fill up memory on the server.
The text was updated successfully, but these errors were encountered: