Skip to content

Commit

Permalink
Merge pull request #756 from Mark-Simulacrum/debug-crater
Browse files Browse the repository at this point in the history
Fix marking GitHub-sourced experiment crates as complete
  • Loading branch information
Mark-Simulacrum authored Dec 12, 2024
2 parents 61ed2a4 + 0e26039 commit c2a7846
Showing 1 changed file with 24 additions and 6 deletions.
30 changes: 24 additions & 6 deletions src/results/db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,31 @@ impl<'a> DatabaseDB<'a> {
data: &ProgressData,
encoding_type: EncodingType,
) -> Fallible<()> {
let krate = if let Some((old, new)) = &data.version {
// If we're updating the name of the crate (typically changing the hash we found on
// github) then we ought to also use that new name for marking the crate as complete.
// Otherwise, we leave behind the old (unversioned) name and end up running this crate
// many times, effectively never actually completing it.
self.update_crate_version(ex, old, new)?;

// sanity check that the previous name of the crate is the one we intended to run.
if old.id() != data.result.krate.id() {
log::warn!(
"Storing result under {} despite job intended for {} (with wrong name old={})",
new.id(),
data.result.krate.id(),
old.id(),
);
}

new
} else {
&data.result.krate
};

self.store_result(
ex,
&data.result.krate,
krate,
&data.result.toolchain,
&data.result.result,
&base64::engine::general_purpose::STANDARD
Expand All @@ -94,11 +116,7 @@ impl<'a> DatabaseDB<'a> {
encoding_type,
)?;

if let Some((old, new)) = &data.version {
self.update_crate_version(ex, old, new)?;
}

self.mark_crate_as_completed(ex, &data.result.krate)?;
self.mark_crate_as_completed(ex, krate)?;

Ok(())
}
Expand Down

0 comments on commit c2a7846

Please sign in to comment.