Skip to content
Merged
Show file tree
Hide file tree
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
4 changes: 3 additions & 1 deletion src/image/layer/create.zig
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,9 @@ fn writeTarFromDir(
}

try file_writer.interface.flush();
tar_file.sync(std.Options.debug_io) catch {};
// a failed fsync means the layer tar may not be durable; surface it
// rather than silently hashing a possibly-unflushed file.
tar_file.sync(std.Options.debug_io) catch |err| log.warn("layer tar fsync failed: {}", .{err});

var hash_file = try cwd().openFile(std.Options.debug_io, tar_path, .{});
defer hash_file.close(std.Options.debug_io);
Expand Down
4 changes: 3 additions & 1 deletion src/image/registry/blob_transfer.zig
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,9 @@ fn downloadBlobUrlToStore(
tmp_file.writeStreamingAll(std.Options.debug_io, chunk_buf[0..bytes_read]) catch return error.NetworkError;
}

tmp_file.sync(std.Options.debug_io) catch {};
// surface a failed fsync — the digest verify below still guards
// correctness, but a silent sync failure hides a durability problem.
tmp_file.sync(std.Options.debug_io) catch |err| log.warn("blob download fsync failed: {}", .{err});
try verifyFileDigest(tmp_path, expected);
blob_store.commitTempBlob(tmp_path, expected) catch return error.NetworkError;
committed = true;
Expand Down
4 changes: 2 additions & 2 deletions src/image/store/blob_runtime.zig
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ pub fn putBlobFromFile(source_path: []const u8, expected_digest: digest_support.
break;
};
}
dest_file.sync(std.Options.debug_io) catch {};
dest_file.sync(std.Options.debug_io) catch |err| log.warn("blob copy fsync failed: {}", .{err});

if (!write_ok) {
cwd().deleteFile(std.Options.debug_io, tmp_path) catch {};
Expand Down Expand Up @@ -89,7 +89,7 @@ fn writeToStore(data: []const u8, digest: digest_support.Digest) types.BlobError
cwd().deleteFile(std.Options.debug_io, tmp_path) catch {};
return types.BlobError.WriteFailed;
};
file.sync(std.Options.debug_io) catch {};
file.sync(std.Options.debug_io) catch |err| log.warn("blob store fsync failed: {}", .{err});

renameTempToBlob(tmp_path, digest) catch return types.BlobError.WriteFailed;
}
Expand Down
Loading