-
Type: Bug
-
Resolution: Works as Designed
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
Labels:
Hi,
I have code where at some point, a call to update_one never comes back (the tokio thread is locked, but hard to know where, the call stack shows only tokio stuff).
I reproduced in a minimal way :
futures_03::executor::block_on( async { for i in 0..100 { update().await; } } ); pub async fn update() { let storage = &services::get().storage; storage .get::<Server>() .update_one(...) .await .map_err(|e| format!("Connection state can't be updated in database: {}", e))?; }
If I don't run the update inside a block_on() call, it works well. As soon as I am in a block_on() call, the first 18 calls works, but the 19, doesn't. I looked my server logs to see if I could understand something there. I saw different log for the last one who never comes back :
The last request receive by the server contains one thing different from the other
2020-07-09T21:28:27.190+0000 I COMMAND [conn69] command waykden.$cmd appName: "WaykDen" command: update { update: "server", updates: [ { q: { cow_id: 0 }, u: { $set: { connection_state: "Offline", last_seen: new Date(1594330107189) }, $unset: { cow_id: "" } } } ], ordered: true, $db: "waykden" } numYields:0 reslen:60 locks:{ ParallelBatchWriterMode: { acquireCount: { r: 2 } }, ReplicationStateTransition: { acquireCount: { w: 2 } }, Global: { acquireCount: { r: 1, w: 1 } }, Database: { acquireCount: { w: 1 } }, Collection: { acquireCount: { w: 1 } }, Mutex: { acquireCount: { r: 1 } } } flowControl:{ acquireCount: 1, timeAcquiringMicros: 1 } storage:{} protocol:op_msg 0ms
In all previous command, I have never the field "timeAcquiringMicros:1". I don't know if it could give a hint.
Any hint would be useful. Of course, I could update all my libraries to use future_03 and don't have to use the block_on block, but it is needed for now. Do you have an idea what could be the issue ?