Merge branch 'master' into cmds

This commit is contained in:
Nick Cameron 2021-01-13 16:07:39 +13:00 committed by GitHub
commit 0e7839be76
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 2 deletions

View File

@ -110,7 +110,7 @@ pub use crate::request::RetryOptions;
pub use crate::timestamp::{Timestamp, TimestampExt}; pub use crate::timestamp::{Timestamp, TimestampExt};
#[doc(inline)] #[doc(inline)]
pub use crate::transaction::{ pub use crate::transaction::{
Client as TransactionClient, Snapshot, Transaction, TransactionOptions, CheckLevel, Client as TransactionClient, Snapshot, Transaction, TransactionOptions,
}; };
#[doc(inline)] #[doc(inline)]
pub use config::Config; pub use config::Config;

View File

@ -54,6 +54,8 @@ macro_rules! retry {
let stats = pd_stats($tag); let stats = pd_stats($tag);
let mut last_err = Ok(()); let mut last_err = Ok(());
for _ in 0..LEADER_CHANGE_RETRY { 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 res = {
let $cluster = &$self.cluster.read().await.0; let $cluster = &$self.cluster.read().await.0;
let res = $call.await; let res = $call.await;

View File

@ -11,7 +11,7 @@
pub use client::Client; pub use client::Client;
pub(crate) use lock::{resolve_locks, HasLocks}; pub(crate) use lock::{resolve_locks, HasLocks};
pub use snapshot::Snapshot; pub use snapshot::Snapshot;
pub use transaction::{Transaction, TransactionOptions}; pub use transaction::{CheckLevel, Transaction, TransactionOptions};
mod buffer; mod buffer;
mod client; mod client;