Skip to content

Commit f6de8e1

Browse files
committed
fix deadlock introduced with
6317df7
1 parent 085c526 commit f6de8e1

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/state.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,10 @@ impl State {
144144

145145
let acquire_or_timeout =
146146
time::timeout(timeout, self.wakers.wait_for_resolving(peer_id));
147+
148+
// Release lock on leases, while waiting for acquire_or_timeout! Otherwise, we might
149+
// deadlock.
150+
drop(leases);
147151
// The outer `Err` indicates a timeout.
148152
match acquire_or_timeout.await {
149153
// Locks could be acquired

0 commit comments

Comments
 (0)