Skip to content

feat(read-stall): enable read stall timeout option for gRPC client - #5114

Merged
dangarhs merged 1 commit into
masterfrom
enable-grpc-read-stall-retry
Oct 7, 2026
Merged

dangarhs merged 1 commit into
masterfrom
enable-grpc-read-stall-retry

Conversation

@dangarhs

@dangarhs dangarhs commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Description

  • Upgraded cloud.google.com/go/storage from v1.65.1 to v1.69.0 (which includes googleapis/google-cloud-go#20525 supporting WithReadStallTimeout on gRPC reads) and github.com/googleapis/gax-go/v2 to v2.26.2.
  • Consolidated the experimental.WithReadStallTimeout client option and dynamic delay environment variable configuration (DYNAMIC_READ_REQ_INCREASE_RATE and DYNAMIC_READ_REQ_INITIAL_TIMEOUT) into addReadStallTimeoutOptions in internal/storage/storage_handle.go.
  • Enabled addReadStallTimeoutOptions in createClientOptionForGRPCClient so that both standard and bidi gRPC storage clients receive the read stall timeout configuration when gcs-retries.read-stall.enable is true.
  • Replaced deprecated experimental.WithGRPCBidiReads() calls with storage.WithGRPCBidiReads() in internal/storage/storage_handle.go and tools/integration_tests/util/.
  • Added unit tests for gRPC client option and client creation with ReadStallRetryConfig in internal/storage/storage_handle_test.go.

Link to the issue in case of a bug fix.

NA

Testing details

  1. Manual - Verified client option wiring and compilation with cloud.google.com/go/storage v1.69.0.
  2. Unit tests - Added and passed Test_CreateClientOptionForGRPCClient_WithReadStallRetryAddsOneOption and TestCreateGRPCClientHandle_WithReadStallRetry (go test -v ./internal/storage -run TestStorageHandleTestSuite).
  3. Integration tests - NA

Any backward incompatible change? If so, please explain.

No

@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 refactors the read stall retry configuration by extracting it into a reusable helper function addReadStallTimeoutOptions for both HTTP and gRPC clients, and adds corresponding unit tests. The feedback suggests optimizing the os.Setenv calls to avoid unnecessary system calls and potential race conditions, and using t.Setenv in the tests to prevent environment pollution.

Comment thread internal/storage/storage_handle.go Resolved
Comment thread internal/storage/storage_handle_test.go Resolved
Comment thread internal/storage/storage_handle_test.go Resolved
Comment thread internal/storage/storage_handle_test.go Resolved
Comment thread internal/storage/storage_handle_test.go Resolved
@codecov

codecov Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 76.92308% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 84.73%. Comparing base (056a6d5) to head (ad22c8e).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
internal/storage/storage_handle.go 76.92% 3 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           master    #5114       +/-   ##
===========================================
+ Coverage        0   84.73%   +84.73%     
===========================================
  Files           0      178      +178     
  Lines           0    19628    +19628     
===========================================
+ Hits            0    16632    +16632     
- Misses          0     2995     +2995     
- Partials        0        1        +1     
Flag Coverage Δ
unittests 84.73% <76.92%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ 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.

@dangarhs
dangarhs force-pushed the enable-grpc-read-stall-retry branch from 3babb0e to 92f30c8 Compare September 24, 2026 13:02
@dangarhs dangarhs changed the title feat(storage): enable read stall timeout option for gRPC client feat(read-stall): enable read stall timeout option for gRPC client Sep 24, 2026
@dangarhs
dangarhs force-pushed the enable-grpc-read-stall-retry branch from 92f30c8 to 8b3bd75 Compare October 5, 2026 11:56
@dangarhs
dangarhs force-pushed the enable-grpc-read-stall-retry branch from 8b3bd75 to ad22c8e Compare October 6, 2026 09:17
@dangarhs

dangarhs commented Oct 6, 2026

Copy link
Copy Markdown
Contributor Author

/gemini review

@dangarhs
dangarhs marked this pull request as ready for review October 6, 2026 09:33
@dangarhs
dangarhs requested review from a team, anushka567 and meet2mky as code owners October 6, 2026 09:33
@github-actions github-actions Bot added the remind-reviewers Auto remind reviewers in attention set for review post 24hrs of inactivity on PR. label Oct 6, 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 Google Cloud Storage Go SDK dependency to v1.69.0, migrates WithGRPCBidiReads from the experimental package to the stable storage package, and refactors the read stall timeout configuration logic into a reusable helper function used by both HTTP and gRPC clients. Additionally, new unit tests are introduced to verify gRPC client creation under various read stall retry configurations. The review feedback highlights potential side effects from modifying global environment variables via os.Setenv during client creation and testing, recommending that these variables be explicitly unset when the feature is disabled and cleaned up after tests run to prevent configuration leakage.

Comment thread internal/storage/storage_handle.go Resolved
Comment thread internal/storage/storage_handle_test.go Resolved
@dangarhs
dangarhs merged commit fac0483 into master Oct 7, 2026
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

remind-reviewers Auto remind reviewers in attention set for review post 24hrs of inactivity on PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

⌂ 换网址