Open await-ovo opened 10 months ago
Can you add a test?
Yes, I'll try to add the related test ~
I'm not sure how this will impact the performance of using pacquet without lockfile because the current algorithm in its current state is very bad. See: https://github.com/pnpm/pacquet/issues/133, https://github.com/pnpm/pacquet/issues/134.
Let's say we have a project that has
express
in dependencies and devDependencies:Running
pacquet/target/debug/pacquet install
over and over again under this project sometimes hangs forever.Inspect thread's backtrace using rust-lldb you can see that there seems to be a deadlock in the dashmap:
It looks like dashmap doesn't recommend keeping references across
.await
, which should also be the cause of the deadlock here, if I understand correctly.Since I'm new to Rust, I'm not sure if there's a better way to solve this problem, I tried replacing the dashmap with
RwLock
like in this PR and it seems to work fine.