summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Chen <brianc118@meta.com>2023-12-28 09:29:28 -0800
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>2023-12-28 09:29:28 -0800
commit49a0b671a1eaa17e25a44b86335285fa27eaeaaf (patch)
treec31c624202484506b882077eed9fb06a4b6e4125
parent98dc65daf9ae8e104dc8b5e44a021b2ac24d09f8 (diff)
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
-rw-r--r--below/src/main.rs7
1 files changed, 6 insertions, 1 deletions
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;
}