[GODRIVER-682] Improve Semantics of Cursor Created: 10/Dec/18 Updated: 07/Aug/20 Resolved: 07/Aug/20 |
|
| Status: | Closed |
| Project: | Go Driver |
| Component/s: | CRUD |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Kristofer Brandow (Inactive) | Assignee: | Unassigned |
| Resolution: | Won't Do | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||
| Case: | (copied to CRM) | ||||||||||||||||||||
| Description |
|
To enable the use of context deadlines and timeouts we need to ensure that we don't send a request if a deadline is approaching. For tailable await cursors, we can set maxTimeMS, which will help ensure the server returns within a desirable amount of time. If a context is cancelled or we do exceed the deadline, the cursor needs to be closed (and potentially killed), and the socket that was used needs to be closed.
|
| Comments |
| Comment by Divjot Arora (Inactive) [ 07/Aug/20 ] |
|
Marking "Won't Do" because it'll be done as part of DRIVERS-555 and I can't think of a better resolution for it now. |
| Comment by Divjot Arora (Inactive) [ 07/Aug/20 ] |
|
Automatically deriving a maxTimeMS from context deadlines will be done as part of DRIVERS-555. We'll also flesh out the semantics of how cursors interact with operation timeouts as part of that project, so I'm closing this out with a link to that ticket. |
| Comment by Craig Wilson [ 12/Dec/18 ] |
|
In a language like go where we have great support for coroutines, tailable cursors should almost always be executed in a goroutine. Because of this, a tailable cursor should block and only iterate once a result is present. Cancelling the context will also terminate the cursor. To support the resumable token, I'd suggest allow the user to provide a callback and register for resumable token notifications. If the user doesn't care, then they don't need to register. Regardless, it keeps this bit of bookkeeping out of the main cursor processing loop and allows it to focus on it's real job. |