Skip to content

Commit 96156f7

Browse files
committed
Try fix occasional benchmark file decompression failures
For longer running benchmarks we download an xz compressed archive containing debug data for a certain kernel version. In recent times the decompression has started failing in CI, for no apparent reason. Local reproduction has failed. Looking at the code, it seems possible that we experienced short write during download and then discarded the unwritten rest. Switch from using std::io::Write::write() to std::io::Write::write_all() in an attempt to fix this issues. Signed-off-by: Daniel Müller <deso@posteo.net>
1 parent e650f41 commit 96156f7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

dev/build.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,7 @@ fn zip(files: &[PathBuf], dst: &Path) {
454454
let contents = read_file(file).unwrap();
455455
let path = file.strip_prefix(dst_dir).unwrap();
456456
let () = zip.start_file(path.to_str().unwrap(), options).unwrap();
457-
let _count = zip.write(&contents).unwrap();
457+
let _count = zip.write_all(&contents).unwrap();
458458
}
459459
}
460460

@@ -919,7 +919,7 @@ fn download_multi_part(base_url: &reqwest::Url, part_count: usize, dst: &Path) {
919919
for part in 1..=part_count {
920920
let url = reqwest::Url::parse(&format!("{}.part{part}", base_url.as_str())).unwrap();
921921
let response = client.get(url).send().unwrap();
922-
let _count = dst.write(&response.bytes().unwrap()).unwrap();
922+
let _count = dst.write_all(&response.bytes().unwrap()).unwrap();
923923
}
924924
}
925925

0 commit comments

Comments
 (0)