mirror of https://github.com/tikv/client-rust.git
Merge pull request #224 from ekexium/deadlock-comment
Add some comment for deadlock #219
This commit is contained in:
commit
0c68c51d63
|
@ -54,6 +54,8 @@ macro_rules! retry {
|
|||
let stats = pd_stats($tag);
|
||||
let mut last_err = Ok(());
|
||||
for _ in 0..LEADER_CHANGE_RETRY {
|
||||
// use the block here to drop the guard of the read lock,
|
||||
// otherwise `reconnect` will try to acquire the write lock and results in a deadlock
|
||||
let res = {
|
||||
let $cluster = &$self.cluster.read().await.0;
|
||||
let res = $call.await;
|
||||
|
|
Loading…
Reference in New Issue