googleapis / googleapis/google-cloud-rust

Clean server close of bidi read stream treated as success with pending ranges

Open
#6,688 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.

In `src/storage/src/storage/bidi/worker.rs`, when the server closes the bidi read stream, `Worker::run` handles `Ok(None)` by returning `Ok(())`:

https://github.com/googleapis/google-cloud-rust/blob/f02b42c2ac5720334cd2b5335824bd4166264527/src/storage/src/storage/bidi/worker.rs#L74

https://github.com/googleapis/google-cloud-rust/blob/f02b42c2ac5720334cd2b5335824bd4166264527/src/storage/src/storage/bidi/worker.rs#L98-L101

The worker returns success without verifying that `self.ranges` is empty. Any pending readers observe a stream EOF and treat the truncated read as success.

Furthermore, exiting `Worker::run` drops the `requests` channel receiver while the parent `ObjectDescriptor` remains live. Any subsequent `read_range()` call on the `ObjectDescriptor` panics on `.expect("worker never exits while ObjectDescriptor is live")`:

https://github.com/googleapis/google-cloud-rust/blob/f02b42c2ac5720334cd2b5335824bd4166264527/src/storage/src/storage/bidi/transport.rs#L135-L138

Contributor guide

Open the contributing guide

Research direction

Read Worker::run in src/storage/src/storage/bidi/worker.rs, especially its Ok(None) handling, then trace read_range() and the request channel in src/storage/src/storage/bidi/transport.rs. Confirm the behavior with pending ranges and a later read_range() call; done means truncated reads are not reported as successful and a live ObjectDescriptor does not panic after clean server closure.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.