-
Notifications
You must be signed in to change notification settings - Fork 455
CDRIVER-5548 new mongoc_client_update_sockettimeoutms() #1556
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
Conversation
Hi @scotthunt thank you for the PR. Can you elaborate on the motivation? E.g. what operations require a different
There is future planned work that may conflict with this change. Client-Side Operation Timeout proposes a unified timeout (CDRIVER-3786) that deprecates socketTimeoutMS. There may be preferable alternatives: e.g. specifying |
Our application encompasses various database-related activities, some of which are stores or simple retrieves while others are scans across millions of rows with regex matches applied. I'm certainly open to alternatives. In my quick perusal, however, it does not appear that |
I expect less pools would result in less total connections. Each pool shares connections for monitoring. And two pools cannot share connections for operations. If connection count is a concern, the
Many server operations support If the server returns an error due to the operation exceeding Here is an example of setting different |
@scotthunt does using |
I don't believe so, no. But we have MongoDB consulting hours scheduled on April 23th to discuss more in depth, after that we'll hopefully have a concrete plan for moving forward. |
Here are my thoughts, for whatever they're worth:
So: What is the plan for client-side timeouts going forward? And am I going to be able to change them on a connection object after popping it from a connection pool? And how soon might those changes actually come about? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the additional feedback. Please see suggested additional commits on this branch.
Not all server operations appear to support maxTimeMS (including perhaps all write operations?)
I expect most do. This example shows setting maxTimeMS
on an insert operation.
I do not view a server-side timeout as a replacement for a client-side timeout. Ideally, I would use both, with the server-side value set somewhat smaller than the client-side one?
I agree. Plus, some maxTimeMS
behavior is subtle. For example: maxTimeMS
set on find
applies to the cumulative lifetime of the returned cursor (i.e. including all getMore
commands).
Client-Side Operation Timeout (CSOT) specifies similar behavior: a socket timeout is used in combination with a smaller maxTimeMS
(taking the estimated RTT into account).
And how soon might those changes actually come about?
I expect CSOT is a large project and do not expect it to be completed in the near future. This PR seems like a reasonable interim solution.
|
Yes please. Or I can try committing directly to this branch if you prefer. |
* this allows use of a single mongoc_client_pool_t even when different timeout values are desired * note: timeout is restored on mongoc_client_pool_push() --------- Co-authored-by: Kevin Albertson <[email protected]>
rebased on master and squashed all your commits in (and adjusted the commit message with a Co-Author message) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Thank you for the contribution @scotthunt. This is planned to be included in the 1.27.0 release later this week. |
@scotthunt |
so multiple pools are not necessary to accomodate different timeouts