Skip to content

Commit 7d96677

Browse files
Merge pull request #680 from jyn514/loopy
Don't retry infinitely many times on no output
2 parents 86df5ce + e7f1b99 commit 7d96677

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

collector/src/bin/rustc-perf-collector/execute.rs

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -424,6 +424,7 @@ pub struct MeasureProcessor<'a> {
424424
patched_incr_stats: Vec<(Patch, (Stats, Option<SelfProfile>))>,
425425
is_first_collection: bool,
426426
self_profile: bool,
427+
tries: u8,
427428
}
428429

429430
impl<'a> MeasureProcessor<'a> {
@@ -450,6 +451,7 @@ impl<'a> MeasureProcessor<'a> {
450451
is_first_collection: true,
451452
// Command::new("summarize").status().is_ok()
452453
self_profile,
454+
tries: 0,
453455
}
454456
}
455457

@@ -570,11 +572,17 @@ impl<'a> Processor for MeasureProcessor<'a> {
570572
Ok(Retry::No)
571573
}
572574
Err(DeserializeStatError::NoOutput(output)) => {
573-
log::warn!(
574-
"failed to deserialize stats, retrying; output: {:?}",
575-
output
576-
);
577-
Ok(Retry::Yes)
575+
if self.tries < 5 {
576+
log::warn!(
577+
"failed to deserialize stats, retrying (try {}); output: {:?}",
578+
self.tries,
579+
output
580+
);
581+
self.tries += 1;
582+
Ok(Retry::Yes)
583+
} else {
584+
panic!("failed to collect statistics after 5 tries");
585+
}
578586
}
579587
Err(e @ DeserializeStatError::ParseError { .. }) => {
580588
panic!("process_perf_stat_output failed: {:?}", e);

0 commit comments

Comments
 (0)