Skip to content

fix(storage): support download stall timeout in async BiDi reads - #16418

Merged
kalragauri merged 3 commits into
googleapis:mainfrom
kalragauri:feat/bidi-download
Sep 9, 2026
Merged

kalragauri merged 3 commits into
googleapis:mainfrom
kalragauri:feat/bidi-download

Conversation

@kalragauri

@kalragauri kalragauri commented Sep 8, 2026 •

Copy link
Copy Markdown
Contributor

When opening an async bidirectional read stream (AsyncBidiReadObject), a network stall or silent disconnect during the initial stream handshake (Start, Write, or initial Read) can cause the call to hang indefinitely.

This PR does the following:

  • Wraps AsyncBidiReadObject streaming RPC with AsyncStreamingReadWriteRpcTimeout in OpenObject::Call().
  • Extracts timeout configuration from DownloadStallTimeoutOption or TransferStallTimeoutOption, setting the expected chunk size to ServiceConstants::MAX_READ_CHUNK_BYTES (2 MiB).
  • Adds unit tests in open_object_test.cc verifying watchdog timer scheduling, reset on progress, and stream cancellation on timeout.

@product-auto-label product-auto-label Bot added the api: storage Issues related to the Cloud Storage API. label Sep 8, 2026

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

Copy link
Copy Markdown

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 introduces timeout handling to the asynchronous OpenObject RPC stream by wrapping the underlying RPC with AsyncStreamingReadWriteRpcTimeout using a scaled stall timeout, and adds a corresponding unit test to verify timeout cancellation. The review feedback suggests replacing several usages of auto with explicit types (for timeout, rpc, pending, and response) to adhere to the repository's style guide against obscuring domain and return types.

Comment thread google/cloud/storage/internal/async/open_object.cc Outdated
Comment thread google/cloud/storage/internal/async/open_object_test.cc Outdated
Comment thread google/cloud/storage/internal/async/open_object_test.cc Outdated
@kalragauri
kalragauri marked this pull request as ready for review September 8, 2026 09:25
@kalragauri
kalragauri requested review from a team as code owners September 8, 2026 09:25
@codecov

codecov Bot commented Sep 8, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.28%. Comparing base (9230136) to head (78ea5f8).

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #16418   +/-   ##
=======================================
  Coverage   92.28%   92.28%           
=======================================
  Files        2246     2246           
  Lines      212584   212648   +64     
=======================================
+ Hits       196175   196237   +62     
- Misses      16409    16411    +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.

Comment thread google/cloud/storage/internal/async/open_object.cc
@kalragauri
kalragauri merged commit 708d35a into googleapis:main Sep 9, 2026
66 checks passed

This branch was previously deployed

1 inactive deployment
false — 78ea5f86 Deployed Sep 9, 2026 by kalragauri via Save PR ref #11581
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.

2 participants