Repository navigation
fix(storage): fail bidi reads on unexpected server OK - #7382
Conversation
There was a problem hiding this comment.
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.
091d1cc to
f043050
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
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
f043050 to
efcb315
Compare
Previously,
Worker::runexited withOk(())when the server closed aBidiReadObjectstream withOKwhileObjectDescriptorwas still live. This silently truncated in-flight range reads and dropped therequestsreceiver, causing laterread_range()calls to panic.Fix this by treating an unexpected
Ok(None)inWorker::handle_responseas an unrecoverable error so in-flight and subsequent reads fail withReadError::UnrecoverableBidiReadInterrupt.Fixes #6688