-
Notifications
You must be signed in to change notification settings - Fork 1.8k
feat(NODE-6520): add client side operations timeoutMS #4095
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
5688ba8 to
b878c6c
Compare
baileympearson
left a comment
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.
left some small comments. I'm out this week, so don't consider them blocking!
|
Bookkeeping: |
test/integration/client-side-operations-timeout/client_side_operations_timeout.unit.test.ts
Show resolved
Hide resolved
|
@aditi-khare-mongoDB @nbbeeken should we conditionally clear the timeout on success/a non-timeout failure based on whether or not we created the timeout inside the function that we race the timeout with? |
…4243) Co-authored-by: Warren James <[email protected]> Co-authored-by: Neal Beeken <[email protected]> Co-authored-by: Bailey Pearson <[email protected]>
Co-authored-by: Warren James <[email protected]>
Co-authored-by: Aditi Khare <[email protected]> Co-authored-by: Daria Pardue <[email protected]>
Co-authored-by: Warren James <[email protected]> Co-authored-by: Neal Beeken <[email protected]> Co-authored-by: Bailey Pearson <[email protected]>
Co-authored-by: Neal Beeken <[email protected]>
Co-authored-by: Neal Beeken <[email protected]> Co-authored-by: Aditi Khare <[email protected]>
… fix internal references (#4315)
dariakp
left a comment
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 pending perf comparison
Description
What is changing?
New Error
MongoOperationTimeoutErrorclass that is thrown when a CSOT timeout is encounteredChanges to
TimeoutTimeout.throwIfExpired()methodTimeout.remainingTimegetter methodUpdates to
AbstractOperationtimeoutfieldtimeoutis set at construction if thetimeoutMSoption is providedImplementing CSOT behaviour for server selection
Topology.selectServerto accept atimeoutoption which it will use determine whether it has timed out when defined. Otherwise, constructs aTimeoutusing theserverSelectionMSoption as beforeTopology.selectServerto throw aMongoOperationTimeoutErroron timeout whenoptions.timeoutis provided and retain previous error behaviour otherwise.Topology._connectto pass downtimeouttoServer.commandcall used to execute ping on first connectionImplementing CSOT behaviour for connection checkout
Server.commandto accepttimeoutoption.ConnectionPool.checkOutto accepttimeoutoptionserverSelectionTimeoutMSis greater than the duration on thetimeout, otherwise, computes the time elapsed since server selection completed and creates timeout for theserverSelectionTimeoutMSdeadlineTest changes
Misc changes
resolveOptionsto handletimeoutMSoption propagationcsotMinhelper method that implements the CSOT min algorithm described hereIs there new documentation needed for these changes?
What is the motivation for this change?
Release Highlight
PLACEHOLDER FOR CSOT FEATURE HIGHLIGHT
Double check the following
npm run check:lintscripttype(NODE-xxxx)[!]: descriptionfeat(NODE-1234)!: rewriting everything in coffeescript