spring-data-mongodb icon indicating copy to clipboard operation
spring-data-mongodb copied to clipboard

Support for Client-Side Operation Timeout

Open gillesbergerp opened this issue 5 months ago • 2 comments

WHAT

Add support for MongoDb's client-side operation timeout (CSOT) which was introduced as an experimental feature in recent versions of the Sync as well as Reactive Streams Java drivers.

WHY

Operation timeouts are an essential tool to prevent long-running and/or expensive queries from impacting a cluster. Right now, it is possible to specify multiple timeout settings on a connection/client level as well as per operation (e.g., maxTimeMS). It would be beneficial to expand the control users have by allowing for overriding timeoutMS on a per-operation basis as wel..

REFERENCES

  • https://github.com/mongodb/specifications/blob/master/source/client-side-operations-timeout/client-side-operations-timeout.md
  • https://www.mongodb.com/docs/languages/java/reactive-streams-driver/current/connect-to-mongo/csot/
  • https://www.mongodb.com/docs/drivers/java/sync/current/connection/specify-connection-options/csot/

gillesbergerp avatar Jun 15 '25 14:06 gillesbergerp

@gillesbergerp I love the idea. Might be worth looking into once the feature is no longer considered experimental.

alexbevi avatar Jun 16 '25 15:06 alexbevi

I am not aware of the precedence when it comes to supporting alpha features but would it be an option to introduce this in an experimental state already? If that is acceptable, I can offer to prepare a pull request.

gillesbergerp avatar Jun 17 '25 02:06 gillesbergerp