-
Notifications
You must be signed in to change notification settings - Fork 91
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
scx_utils: Add retryable errors #549
Conversation
So, in if let Some(dir) = path.parent() {
std::fs::create_dir_all(dir).with_context(|| format!("creating {:?}", dir))?;
} Shouldn't this be enough? It's doing |
I think I see the problem in |
dbb09de
to
8b599ae
Compare
Updated by adding more retryable errors. In the case where the server hadn't started the path wouldn't be found so the stats server connection would never happen. |
rust/scx_utils/src/misc.rs
Outdated
std::io::ErrorKind::NotFound, | ||
std::io::ErrorKind::ConnectionRefused, | ||
].to_vec(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With const array like:
const RETRYABLE_ERRORS: [std::io::ErrorKind; 2] = [
std::io::ErrorKind::NotFound,
std::io::ErrorKind::ConnectionRefused,
];
this doesn't have to be global and moved into monitor_stats()
.
Ah, that makes sense. Thanks for debugging it. |
8b599ae
to
c31f2b6
Compare
Add a set of retryable errors for scx_utils when connecting to the stats server. Signed-off-by: Daniel Hodges <[email protected]>
Automatically (try to) create the socket dir if it doesn't exist. Sometimes the server will fail with: