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

Improve debugging on some error messages #1313

Merged
merged 1 commit into from
Sep 6, 2024
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
4 changes: 3 additions & 1 deletion nativelink-scheduler/src/simple_scheduler_state_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,9 @@ where
},
error: Some(err.clone().merge(make_err!(
Code::Internal,
"Job cancelled because it attempted to execute too many times and failed {}",
"Job cancelled because it attempted to execute too many times {} > {} times {}",
awaited_action.attempts,
self.max_job_retries,
format!("for operation_id: {operation_id}, maybe_worker_id: {maybe_worker_id:?}"),
))),
..ActionResult::default()
Expand Down
4 changes: 2 additions & 2 deletions nativelink-scheduler/tests/simple_scheduler_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2008,8 +2008,8 @@ async fn worker_retries_on_internal_error_and_fails_test() -> Result<(), Error>
if let ActionStage::Completed(stage) = &mut received_state.stage {
if let Some(real_err) = &mut stage.error {
assert!(
real_err.to_string().contains("Job cancelled because it attempted to execute too many times and failed"),
"{real_err} did not contain 'Job cancelled because it attempted to execute too many times and failed'",
real_err.to_string().contains("Job cancelled because it attempted to execute too many times"),
"{real_err} did not contain 'Job cancelled because it attempted to execute too many times'",
);
*real_err = err;
}
Expand Down
5 changes: 3 additions & 2 deletions nativelink-store/src/ac_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,14 @@ pub async fn get_size_and_decode_digest<T: Message + Default + 'static>(
store: &impl StoreLike,
key: impl Into<StoreKey<'_>>,
) -> Result<(T, usize), Error> {
let key = key.into();
// Note: For unknown reasons we appear to be hitting:
// https://github.com/rust-lang/rust/issues/92096
// or a smiliar issue if we try to use the non-store driver function, so we
// are using the store driver function here.
let mut store_data_resp = store
.as_store_driver_pin()
.get_part_unchunked(key.into(), 0, Some(MAX_ACTION_MSG_SIZE))
.get_part_unchunked(key.borrow(), 0, Some(MAX_ACTION_MSG_SIZE))
.await;
if let Err(err) = &mut store_data_resp {
if err.code == Code::NotFound {
Expand All @@ -74,7 +75,7 @@ pub async fn get_size_and_decode_digest<T: Message + Default + 'static>(
.err_tip_with_code(|e| {
(
Code::NotFound,
format!("Stored value appears to be corrupt: {e}"),
format!("Stored value appears to be corrupt: {e} - {key:?}"),
)
})
.map(|v| (v, store_data_len))
Expand Down
2 changes: 2 additions & 0 deletions nativelink-util/src/action_messages.rs
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,8 @@ impl std::fmt::Display for ActionUniqueQualifier {
Self::Uncachable(action) => (false, action),
};
f.write_fmt(format_args!(
// Note: We use underscores because it makes escaping easier
// for redis.
"{}/{}/{}-{}/{}",
unique_key.instance_name,
unique_key.digest_function,
Expand Down