-
Type: Improvement
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
The CMAP spec states that waitQueueTimeoutMS is optional, and it gives the following reasoning:
We are anticipating eventually introducing a single client-side timeout mechanism, making us hesitant to introduce another granular timeout control. Therefore, if a driver/language already has an idiomatic way to implement their timeouts, they should leverage that mechanism over implementing waitQueueTimeoutMS.
Given that CSOT will be implemented soon and in async Rust such timeouts can be implemented by simply not awaiting the future, we should drop it from the public API.
In the meantime, users can just use the timeout functionality from their respective runtimes as a workaround.
e.g. for tokio:
tokio::time::timeout(Duration::from_secs(5), coll.insert_one(doc! { "x": 1 }, None)).await?;
Note this may lead to some connection churn, but it seems to be an acceptable alternative for now.