[CSHARP-4409] Add missing MaxTimeMs to query options Created: 10/Nov/22 Updated: 27/Oct/23 Resolved: 07/Dec/22 |
|
| Status: | Closed |
| Project: | C# Driver |
| Component/s: | API |
| Affects Version/s: | 2.18.0 |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Markus Eggimann | Assignee: | James Kovacs |
| Resolution: | Gone away | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||
| Description |
|
MongoDB supports server side timeout (MaxTimeMs) for nearly all queries. However, the corresponding configuration property is missing on certain option classes:
There might be other properties be missing on those commands. Please add the MaxTimeMs (and probably other missing properties) to the options.
|
| Comments |
| Comment by PM Bot [ 07/Dec/22 ] |
|
There hasn't been any recent activity on this ticket, so we're resolving it. Thanks for reaching out! Please feel free to comment on this if you're able to provide more information. |
| Comment by James Kovacs [ 23/Nov/22 ] |
|
Hi, mongodb.com-account@jean-richard.ch, CSHARP-3393 is a non-trivial amount of work based on our implementations in other driver languages. While we intend to implement support in all our drivers in the coming quarters, we don't have an availability estimate for the .NET/C# Driver yet. Using socketTimeoutMS is definitely a potential workaround in the meantime. If you're running MongoDB 4.2 or later, the server supports socket liveness checking, which will terminate certain inflight operations when the remote client has hung up. See Client Disconnection in the 4.2 release notes and Sincerely, |
| Comment by Meinrad Jean-Richard [ 21/Nov/22 ] |
|
Hi James,
Thanks for your response. Do you have any idea as to when we can expect that feature? For us this is a serious problem in our current deployment. We currently have some operations that take longer than our clientside (socket) timeout. When that timeout expires we usually retry and this makes the DB even slower (basically we start a denial-of-service attack on our own db). Is there any way to work around this issue until the feature you mention is available?
Thanks, Meinrad |
| Comment by James Kovacs [ 15/Nov/22 ] |
|
Hi, meggima.github@outlook.com, Thank you for reaching out to us about this omission in our API. This is a known gap, which is tracked in With CSOT, you specify the total operation time before your application needs a response. This timeout applies to all of the work done to execute the operation, including but not limited to server selection, connection checkout, and server-side execution. Behind the scenes, a calculated maxTimeMS will be applied to operations based on the time remaining. CSOT has already been implemented in the Go ( Please let us know if you have any questions. Sincerely, |
| Comment by Markus Eggimann [ 10/Nov/22 ] |
|
We would be willing to help with this. Would you accept a PR? |