Skip to content

Fix uploading S3 profiles #1796

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

Merged
merged 1 commit into from
Jan 8, 2024
Merged
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
13 changes: 12 additions & 1 deletion collector/src/compile/benchmark/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,11 @@ impl Benchmark {
preparation_start.elapsed().as_secs_f64()
);

// We need to hold on to the directories to keep the files alive until
// the processor post-processes them. We also store them in `ManuallyDrop`
// so that they are not deleted when an error occurs.
let mut timing_dirs: Vec<ManuallyDrop<TempDir>> = vec![];

let benchmark_start = std::time::Instant::now();
for ((backend, profile), prep_dir) in &target_dirs {
let backend = *backend;
Expand Down Expand Up @@ -408,7 +413,7 @@ impl Benchmark {
}
}
}
drop(ManuallyDrop::into_inner(timing_dir));
timing_dirs.push(timing_dir);
}
}
log::trace!(
Expand All @@ -417,6 +422,12 @@ impl Benchmark {
benchmark_start.elapsed().as_secs_f64()
);
processor.postprocess_results().await;

// Now we can release the directories
for dir in timing_dirs {
drop(ManuallyDrop::into_inner(dir));
}

Ok(())
}
}
Expand Down