Skip to content

Conversation

@prestonvasquez
Copy link
Member

@prestonvasquez prestonvasquez commented Feb 14, 2025

Summary

Add an experimental bool to enabled legacy timeout behavior while CSOT is enabled (client.Timeout. >=0). This would make context deadline only applicable to client-side blocking logic and specify MaxTime on the as a server-side timeout.

This is only available for findOne and has to be set directly on the FindOneOptions:

opts := options.FindOne()
opts.UnsafeAllowSeperateMaxTimeMS = true 

_ = coll.FindOne(context.TODO(), bson.D{}, opts)

Background & Motivation

@prestonvasquez prestonvasquez changed the title Add UnsafeAllowSeperateMaxTimeMSWithCSOT (POC) Add UnsafeAllowSeperateMaxTimeMSWithCSOT Feb 14, 2025
@mongodb-drivers-pr-bot mongodb-drivers-pr-bot bot added the review-priority-low Low Priority PR for Review: within 3 business days label Feb 14, 2025
@mongodb-drivers-pr-bot
Copy link
Contributor

mongodb-drivers-pr-bot bot commented Feb 14, 2025

API Change Report

./mongo/options

compatible changes

FindOneOptions.UnsafeAllowSeperateMaxTimeMS: added

./x/mongo/driver

compatible changes

Operation.UnsafeAllowSeperateMaxTimeMS: added

./x/mongo/driver/operation

compatible changes

(*Find).UnsafeAllowSeperateMaxTimeMS: added

@prestonvasquez prestonvasquez changed the title (POC) Add UnsafeAllowSeperateMaxTimeMSWithCSOT (Experimental Behavior) Add UnsafeAllowSeperateMaxTimeMSWithCSOT Feb 14, 2025
@prestonvasquez prestonvasquez changed the title (Experimental Behavior) Add UnsafeAllowSeperateMaxTimeMSWithCSOT (Experimental) Add UnsafeAllowSeperateMaxTimeMSWithCSOT Feb 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

review-priority-low Low Priority PR for Review: within 3 business days

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant