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.
-
AdminAshni (Admin, MongoDB) commented
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 -
Jean-Christophe commented
In our case, the same behaviour would also be desirable on the reactive java driver and the python driver.