pd_client: move ReadableDuration to failpoint
ref tikv/tikv#13673
remove `unused_imports` when make release.
@@ -47,9 +47,7 @@ use kvproto::{
};
use security::SecurityManager;
use tikv_util::{
- box_err,
- config::ReadableDuration,
- error, info,
+ box_err, error, info,
mpsc::future as mpsc,
slow_log, thd_name,
time::{duration_to_sec, Instant},
@@ -71,6 +69,8 @@ use crate::PdFuture;
fn request_timeout() -> Duration {
fail_point!("pd_client_v2_request_timeout", |s| {
use std::str::FromStr;
+
+ use tikv_util::config::ReadableDuration;
ReadableDuration::from_str(&s.unwrap()).unwrap().0
});
Duration::from_secs(REQUEST_TIMEOUT_SEC)
@@ -412,6 +412,8 @@ async fn reconnect_loop(
let backoff = (|| {
fail_point!("pd_client_v2_backoff", |s| {
use std::str::FromStr;
+
+ use tikv_util::config::ReadableDuration;
ReadableDuration::from_str(&s.unwrap()).unwrap().0
});
request_timeout()
