#How to find tokio test deadlock
7 messages · Page 1 of 1 (latest)
what's the line of code that's deadlocking?
This function deadlocks.
The computation is finished successfully and sent to the channel. Just the other side of that channel never wakes up again.
I suspect the issue is in another task that runs during waiting for the computation and blocks.
I just can't find it.
pub async fn derive_key(&self, secret: Vec<u8>) -> Result<[u8; 32]> {
let params = self.get_params().map_err(|err| anyhow!(err))?;
let argon = Argon2::new(argon2::Algorithm::Argon2id, argon2::Version::V0x10, params);
let salt_bytes = self.salt.as_bytes().to_owned();
debug!("spawning blocking task");
let result = tokio::task::spawn_blocking(move || {
// debug!("running blocking task");
let mut hash = [0u8; 32];
let result = argon
.hash_password_into(&secret, &salt_bytes, &mut hash)
.map(move |_| hash)
.map_err(|err| anyhow!(err));
debug!("blocking computation ready");
result
})
.await?;
debug!("blocking task completed");
result
}
why would that be related? 
Ah, i thought I asked another question here. Oops.
Still no idea where the deadlock comes from. Gotta figure this out one day, but I have no idea on my own
Could not reproduce it