fix(multipart): clean temp part data on failure (#4412)

fix(multipart): clean failed part temp data
This commit is contained in:
Zhengchao An
2026-07-08 15:01:37 +08:00
committed by GitHub
parent 80cc3b1fcf
commit cda7688909
2 changed files with 282 additions and 212 deletions
+6 -3
View File
@@ -2322,7 +2322,7 @@ mod b3_write_quorum_tests {
}
#[cfg(test)]
mod hermetic_set_disks_support {
pub(in crate::set_disk::ops) mod hermetic_set_disks_support {
//! Shared hermetic `SetDisks` construction for the ops tests below: the
//! `SetDisks` under test is built directly on formatted local disks (same
//! pattern as the `ops/locking.rs` tests) so the tests stay hermetic — no
@@ -2334,7 +2334,10 @@ mod hermetic_set_disks_support {
use tempfile::TempDir;
use tokio::sync::RwLock;
pub(super) async fn make_formatted_local_disk(disk_idx: usize, format: &FormatV3) -> (TempDir, Endpoint, DiskStore) {
pub(in crate::set_disk::ops) async fn make_formatted_local_disk(
disk_idx: usize,
format: &FormatV3,
) -> (TempDir, Endpoint, DiskStore) {
let dir = tempfile::tempdir().expect("tempdir should be created");
let mut endpoint =
Endpoint::try_from(dir.path().to_str().expect("tempdir path should be utf8")).expect("endpoint should parse");
@@ -2361,7 +2364,7 @@ mod hermetic_set_disks_support {
(dir, endpoint, disk)
}
pub(super) async fn hermetic_set_disks(disk_count: usize) -> (Vec<TempDir>, Vec<DiskStore>, Arc<SetDisks>) {
pub(in crate::set_disk::ops) async fn hermetic_set_disks(disk_count: usize) -> (Vec<TempDir>, Vec<DiskStore>, Arc<SetDisks>) {
let format = FormatV3::new(1, disk_count);
let mut temp_dirs = Vec::with_capacity(disk_count);