googleapis / googleapis/google-cloud-rust

Buffered upload drops a chunk after transport-level PUT failure

Open
#6,685 0 comments 0 reactions 0 assignees View on GitHub
api: storage type: bug
Dominant language
Rust
Stars
955
Forks
144
Avg merge
1d 5h
Merged PRs (30d)
279

Description

Unconfirmed. This is the result of a search with Claude, may be a false positive.

During a buffered upload, a connection reset, timeout, or other transport error during a chunk PUT returns an `Err` from `send().await`:

https://github.com/googleapis/google-cloud-rust/blob/f02b42c2ac5720334cd2b5335824bd4166264527/src/storage/src/storage/perform_upload/buffered.rs#L127

Because the error is propagated immediately using `?`, `progress.handle_error()` is never invoked. On the subsequent retry attempt, `progress.needs_query()` remains `false` because `persisted_size` still matches `offset`:

https://github.com/googleapis/google-cloud-rust/blob/f02b42c2ac5720334cd2b5335824bd4166264527/src/storage/src/storage/perform_upload/buffered/progress.rs#L104-L106

Consequently, the status query is skipped and `next_buffer()` replaces the unacknowledged chunk `k` with chunk `k + 1`, which is then PUT at chunk `k`'s offset. Because checksums are not sent on resumed chunks, the server accepts the corrupted/truncated upload.

Contributor guide

Open the contributing guide

Research direction

Start by reading src/storage/src/storage/perform_upload/buffered.rs around the chunk PUT and src/storage/src/storage/perform_upload/buffered/progress.rs around needs_query(). Confirm the transport-error retry path and add coverage for a failed chunk PUT; done means the unacknowledged chunk is not replaced and the resumed upload remains correct.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cloud
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
72/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.