Skip to content
Open
Changes from 1 commit
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
1 change: 1 addition & 0 deletions mountpoint-s3-fs/src/upload.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,10 @@
&self,
bucket: String,
key: String,
initial_offset: u64,

Check warning on line 152 in mountpoint-s3-fs/src/upload.rs

View workflow job for this annotation

GitHub Actions / Formatting

Diff in /home/runner/work/mountpoint-s3/mountpoint-s3/mountpoint-s3-fs/src/upload.rs
initial_etag: Option<ETag>,
) -> AppendUploadRequest<Client> {
assert!(self.buffer_size > 0, "write-part-size should be greater than 0 for incremental uploads");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems the wrong place to check. Why not UploaderConfig::new (where buffer_size is passed)?

Also, the message here should be related to this type, rather than user-facing. --write-part-size is a CLI argument and should be validated elsewhere.

Copy link
Contributor

@c-hagem c-hagem Jul 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should consider making the size (NonZero)[https://doc.rust-lang.org/std/num/type.NonZeroU32.html]?

// Limit the queue capacity to hold buffers for a total of at most
// MAX_BYTES_IN_QUEUE, but ensure it allows at least 1 buffer.
let capacity = (MAX_BYTES_IN_QUEUE / self.buffer_size).max(1);
Expand Down
Loading