Skip to content

fix(storage): fail bidi reads on unexpected server OK - #7382

Merged
joshuatants merged 1 commit into
googleapis:mainfrom
joshuatants:fix/storage-bidi-unexpected-ok
Nov 8, 2026
Merged

joshuatants merged 1 commit into
googleapis:mainfrom
joshuatants:fix/storage-bidi-unexpected-ok

Conversation

@joshuatants

@joshuatants joshuatants commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Previously, Worker::run exited with Ok(()) when the server closed a BidiReadObject stream with OK while ObjectDescriptor was still live. This silently truncated in-flight range reads and dropped the requests receiver, causing later read_range() calls to panic.

Fix this by treating an unexpected Ok(None) in Worker::handle_response as an unrecoverable error so in-flight and subsequent reads fail with ReadError::UnrecoverableBidiReadInterrupt.

Fixes #6688

@joshuatants
joshuatants requested review from a team as code owners November 5, 2026 03:13
@product-auto-label product-auto-label Bot added the api: storage Issues related to the Cloud Storage API. label Nov 5, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request updates the bidirectional streaming read worker to fail all active and subsequent reads with an unrecoverable interrupt error (ReadError::UnrecoverableBidiReadInterrupt) if the stream closes unexpectedly, matching the behavior of the Go client library. It also updates the documentation for ObjectDescriptor to reflect this behavior and adds corresponding unit tests to verify the error handling on unexpected stream closures. I have no feedback to provide as there are no review comments.

@joshuatants
joshuatants force-pushed the fix/storage-bidi-unexpected-ok branch 3 times, most recently from 091d1cc to f043050 Compare November 5, 2026 05:02
@codecov

codecov Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.65%. Comparing base (e0e7bfa) to head (efcb315).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7382      +/-   ##
==========================================
- Coverage   98.65%   98.65%   -0.01%     
==========================================
  Files         334      334              
  Lines      145392   145483      +91     
==========================================
+ Hits       143433   143522      +89     
- Misses       1959     1961       +2     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Previously, `Worker::run` exited with `Ok(())` when the server closed a
`BidiReadObject` stream with `OK` while `ObjectDescriptor` was still
live. This silently truncated in-flight range reads and dropped the
`requests` receiver, causing later `read_range()` calls to panic.

Fix this by treating an unexpected `Ok(None)` in
`Worker::handle_response` as an unrecoverable error so in-flight and
subsequent reads fail with `ReadError::UnrecoverableBidiReadInterrupt`.

Fixes googleapis#6688
@joshuatants
joshuatants force-pushed the fix/storage-bidi-unexpected-ok branch from f043050 to efcb315 Compare November 8, 2026 20:24
@joshuatants
joshuatants merged commit c72da80 into googleapis:main Nov 8, 2026
43 checks passed
@joshuatants
joshuatants deleted the fix/storage-bidi-unexpected-ok branch November 8, 2026 20:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: storage Issues related to the Cloud Storage API.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

2 participants