Skip to content

Commit 80a51ba

Browse files
krallinfacebook-github-bot
authored andcommitted
buck2: improve an error message
Summary: If we cancel local then try to download from RE and fail, we'll favor showing the local executor's error, but that will not be very helpful because it'll be reported as "Cancelled". The more useful error to show is the RE executor's, which would have taken the claim (causing the cancellation) then failed. So, let's just do that. Now, obviously, the error output will leave open the question of "but *why did this not retry locally*?", but really this behavior is a) subtle and b) rare, there's just not going to be a good way to succinctly explain what went wrong. Reviewed By: themarwhal Differential Revision: D47429620 fbshipit-source-id: 0f325e90a9b4d606702da897bcd294f60af5d254
1 parent e2d844e commit 80a51ba

File tree

1 file changed

+9
-1
lines changed
  • app/buck2_execute_impl/src/executors

1 file changed

+9
-1
lines changed

app/buck2_execute_impl/src/executors/hybrid.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ where
295295
// For the purposes of giving users a good UX, if both things failed, give them the
296296
// local executor's error, which is likely to not have failed because of e.g.
297297
// sandboxing.
298-
let (mut primary_res, secondary_res) = if is_retryable_status(&second_res) {
298+
let (mut primary_res, mut secondary_res) = if is_retryable_status(&second_res) {
299299
if first_priority > second_priority {
300300
(first_res, second_res)
301301
} else {
@@ -305,6 +305,14 @@ where
305305
(second_res, first_res)
306306
};
307307

308+
// But if the first result was a cancelled result then we definitely don't want that.
309+
if matches!(
310+
&primary_res.report.status,
311+
CommandExecutionStatus::Cancelled
312+
) {
313+
std::mem::swap(&mut primary_res, &mut secondary_res);
314+
}
315+
308316
primary_res.rejected_execution = Some(secondary_res.report);
309317
primary_res
310318
} else {

0 commit comments

Comments
 (0)