From 49a0b671a1eaa17e25a44b86335285fa27eaeaaf Mon Sep 17 00:00:00 2001 From: Brian Chen Date: Thu, 28 Dec 2023 09:29:28 -0800 Subject: Fix below GPU stats collection since D52063174 broke it Summary: GPU stats collection is broken. User report: https://fb.workplace.com/groups/505463673566896/permalink/1501842497262337/ Looking at logs, looks like it's related to tokio/srclient: P944160448. D52063174 affectively forces us to use tokio runtime. This is not the first time is has happened (see https://fb.workplace.com/groups/rust.language/posts/6113510662030831/?comment_id=6140563555992208). Reviewed By: boyuni Differential Revision: D52445399 fbshipit-source-id: 95027f74bf5898c97f46f2bd3d94379a83ebd625 --- below/src/main.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/below/src/main.rs b/below/src/main.rs index a3dbd345..14426fd2 100644 --- a/below/src/main.rs +++ b/below/src/main.rs @@ -51,6 +51,7 @@ use slog::warn; use tar::Archive; use tar::Builder as TarBuilder; use tempfile::TempDir; +use tokio::runtime::Builder as TB; use users::get_current_uid; use users::get_user_by_uid; @@ -431,7 +432,11 @@ pub fn start_gpu_stats_thread_and_get_stats_receiver( let mut interval = target_interval; loop { let collect_instant = Instant::now(); - match futures::executor::block_on(collector.collect_and_update()) { + let rt = TB::new_current_thread() + .thread_name("create_fburl") + .build() + .expect("Failed to build tokio runtime."); + match rt.block_on(collector.collect_and_update()) { Ok(_) => { interval = target_interval; } -- cgit v1.2.3