Skip to Main Content

MongoByte MongoDB Logo

Welcome to the new MongoDB Feedback Portal!

{Improvement: "Your idea"}
We’ve upgraded our system to better capture and act on your feedback.
Your feedback is meaningful and helps us build better products.

Status Submitted
Created by Guest
Created on Mar 12, 2024

Allow to set default maxTimeMS for all cursors

By default, a cursor has no maxTimeMS. We want to be able to set the default maxTimeMS so all cursors have it set. The current Java driver does not allow to set that default and each cursor needs it manually specified. I.e. a cursor factory or default options would be great. Alternatively, it would also be great to have this as an option on the cluster itself.
  • Guest
    Jul 22, 2024
    Hi, thank you for the feedback. We are in the process of introducing a new client-wide timeout to Java (JAVA-3828 will be released first in alpha in the v5.2 release of the Java Driver, with a later GA) that will allow for a new timeoutMS setting that will govern the amount of time a single operation can execute before control is returned to the user. This timeout will cover all the work done to execute an operation (including server selection, connection checkout, and server-side execution). Please have a look at the epic -- or the spec, if you'd like to dive deeper -- and share your feedback. Thank you! Epic: https://jira.mongodb.org/browse/JAVA-3828 Spec: https://github.com/mongodb/specifications/blob/master/source/client-side-operations-timeout/client-side-operations-timeout.md
  • Guest
    Apr 10, 2024
    In our case, the same behaviour would also be desirable on the reactive java driver and the python driver.