Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash after wake-up from hibernate: panicked at scheds/rust/scx_bpfla… #1106

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions rust/scx_utils/src/misc.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use anyhow::bail;
use anyhow::Result;
use libc;
use log::info;
use log::{info, warn};
use scx_stats::prelude::*;
use serde::Deserialize;
use std::path::Path;
Expand Down Expand Up @@ -30,7 +30,7 @@ where
Err(e) => match e.downcast_ref::<std::io::Error>() {
Some(ioe) if RETRYABLE_ERRORS.contains(&ioe.kind()) => {
if retry_cnt == 1 {
info!("Stats server not avaliable, retrying...");
info!("Stats server not available, retrying...");
}
retry_cnt += 1;
sleep(Duration::from_secs(1));
Expand All @@ -50,7 +50,11 @@ where
sleep(Duration::from_secs(1));
break;
}
None => Err(e)?,
None => {
warn!("error on handling stats_server result {}", &e);
sleep(Duration::from_secs(1));
break;
}
},
};
output(stats)?;
Expand Down
14 changes: 12 additions & 2 deletions scheds/rust/scx_bpfland/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ use libbpf_rs::skel::Skel;
use libbpf_rs::skel::SkelBuilder;
use libbpf_rs::OpenObject;
use libbpf_rs::ProgramInput;
use log::info;
use log::warn;
use log::{debug, info};
use scx_stats::prelude::*;
use scx_utils::build_id;
use scx_utils::import_enums;
Expand Down Expand Up @@ -612,7 +612,17 @@ fn main() -> Result<()> {
if let Some(intv) = opts.monitor.or(opts.stats) {
let shutdown_copy = shutdown.clone();
let jh = std::thread::spawn(move || {
stats::monitor(Duration::from_secs_f64(intv), shutdown_copy).unwrap()
match stats::monitor(Duration::from_secs_f64(intv), shutdown_copy) {
Ok(_) => {
debug!("stats monitor thread finished successfully")
}
Err(error_object) => {
warn!(
"stats monitor thread finished because of an error {}",
error_object
)
}
}
});
if opts.monitor.is_some() {
let _ = jh.join();
Expand Down
12 changes: 11 additions & 1 deletion scheds/rust/scx_layered/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2288,7 +2288,17 @@ fn main() -> Result<()> {
if let Some(intv) = opts.monitor.or(opts.stats) {
let shutdown_copy = shutdown.clone();
let jh = std::thread::spawn(move || {
stats::monitor(Duration::from_secs_f64(intv), shutdown_copy).unwrap()
match stats::monitor(Duration::from_secs_f64(intv), shutdown_copy) {
Ok(_) => {
debug!("stats monitor thread finished successfully")
}
Err(error_object) => {
warn!(
"stats monitor thread finished because of an error {}",
error_object
)
}
}
});
if opts.monitor.is_some() {
let _ = jh.join();
Expand Down