Skip to content

Commit c2a7846

Browse files
Merge pull request #756 from Mark-Simulacrum/debug-crater
Fix marking GitHub-sourced experiment crates as complete
2 parents 61ed2a4 + 0e26039 commit c2a7846

File tree

1 file changed

+24
-6
lines changed

1 file changed

+24
-6
lines changed

Diff for: src/results/db.rs

+24-6
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,31 @@ impl<'a> DatabaseDB<'a> {
8383
data: &ProgressData,
8484
encoding_type: EncodingType,
8585
) -> Fallible<()> {
86+
let krate = if let Some((old, new)) = &data.version {
87+
// If we're updating the name of the crate (typically changing the hash we found on
88+
// github) then we ought to also use that new name for marking the crate as complete.
89+
// Otherwise, we leave behind the old (unversioned) name and end up running this crate
90+
// many times, effectively never actually completing it.
91+
self.update_crate_version(ex, old, new)?;
92+
93+
// sanity check that the previous name of the crate is the one we intended to run.
94+
if old.id() != data.result.krate.id() {
95+
log::warn!(
96+
"Storing result under {} despite job intended for {} (with wrong name old={})",
97+
new.id(),
98+
data.result.krate.id(),
99+
old.id(),
100+
);
101+
}
102+
103+
new
104+
} else {
105+
&data.result.krate
106+
};
107+
86108
self.store_result(
87109
ex,
88-
&data.result.krate,
110+
krate,
89111
&data.result.toolchain,
90112
&data.result.result,
91113
&base64::engine::general_purpose::STANDARD
@@ -94,11 +116,7 @@ impl<'a> DatabaseDB<'a> {
94116
encoding_type,
95117
)?;
96118

97-
if let Some((old, new)) = &data.version {
98-
self.update_crate_version(ex, old, new)?;
99-
}
100-
101-
self.mark_crate_as_completed(ex, &data.result.krate)?;
119+
self.mark_crate_as_completed(ex, krate)?;
102120

103121
Ok(())
104122
}

0 commit comments

Comments
 (0)