From 9a5ebfac30d11d9d4b23d13a65696f33fd111002 Mon Sep 17 00:00:00 2001 From: BohuTANG Date: Mon, 30 Jan 2023 20:23:31 +0800 Subject: [PATCH 1/2] chore(tokio): remove unused enable_all --- src/common/base/src/runtime/runtime.rs | 4 +--- src/common/base/src/runtime/runtime_tracker.rs | 5 +---- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/src/common/base/src/runtime/runtime.rs b/src/common/base/src/runtime/runtime.rs index c1c67bf6d2784..e8636f0c039ad 100644 --- a/src/common/base/src/runtime/runtime.rs +++ b/src/common/base/src/runtime/runtime.rs @@ -128,9 +128,7 @@ impl Runtime { fn tracker_builder(mem_stat: Arc) -> tokio::runtime::Builder { let mut builder = tokio::runtime::Builder::new_multi_thread(); - builder - .enable_all() - .on_thread_start(mem_stat.on_start_thread()); + builder.on_thread_start(mem_stat.on_start_thread()); builder } diff --git a/src/common/base/src/runtime/runtime_tracker.rs b/src/common/base/src/runtime/runtime_tracker.rs index 2f80e517f17c7..0362e17446b44 100644 --- a/src/common/base/src/runtime/runtime_tracker.rs +++ b/src/common/base/src/runtime/runtime_tracker.rs @@ -596,9 +596,7 @@ mod tests { let f = Foo { i: 3 }; let f = TrackedFuture::create_with_mem_stat(Some(mem_stat.clone()), f); - let rt = tokio::runtime::Builder::new_multi_thread() - .enable_all() - .build()?; + let rt = tokio::runtime::Builder::new_multi_thread().build()?; let v = rt.block_on(f); @@ -665,7 +663,6 @@ mod tests { let rt = tokio::runtime::Builder::new_multi_thread() .worker_threads(5) - .enable_all() .build() .unwrap(); From 90670636ed1753ef058f249817ff7629e841ce52 Mon Sep 17 00:00:00 2001 From: BohuTANG Date: Mon, 30 Jan 2023 21:33:46 +0800 Subject: [PATCH 2/2] enable time --- src/common/base/src/runtime/runtime.rs | 4 +++- src/common/base/src/runtime/runtime_tracker.rs | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/common/base/src/runtime/runtime.rs b/src/common/base/src/runtime/runtime.rs index e8636f0c039ad..0a7505d038de4 100644 --- a/src/common/base/src/runtime/runtime.rs +++ b/src/common/base/src/runtime/runtime.rs @@ -128,7 +128,9 @@ impl Runtime { fn tracker_builder(mem_stat: Arc) -> tokio::runtime::Builder { let mut builder = tokio::runtime::Builder::new_multi_thread(); - builder.on_thread_start(mem_stat.on_start_thread()); + builder + .enable_time() + .on_thread_start(mem_stat.on_start_thread()); builder } diff --git a/src/common/base/src/runtime/runtime_tracker.rs b/src/common/base/src/runtime/runtime_tracker.rs index 0362e17446b44..490aff16f3fd7 100644 --- a/src/common/base/src/runtime/runtime_tracker.rs +++ b/src/common/base/src/runtime/runtime_tracker.rs @@ -596,7 +596,9 @@ mod tests { let f = Foo { i: 3 }; let f = TrackedFuture::create_with_mem_stat(Some(mem_stat.clone()), f); - let rt = tokio::runtime::Builder::new_multi_thread().build()?; + let rt = tokio::runtime::Builder::new_multi_thread() + .enable_time() + .build()?; let v = rt.block_on(f); @@ -663,6 +665,7 @@ mod tests { let rt = tokio::runtime::Builder::new_multi_thread() .worker_threads(5) + .enable_time() .build() .unwrap();