Repository navigation
feat(read-stall): enable read stall timeout option for gRPC client - #5114
Conversation
There was a problem hiding this comment.
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.
Codecov Report❌ Patch coverage is
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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
3babb0e to
92f30c8
Compare
92f30c8 to
8b3bd75
Compare
8b3bd75 to
ad22c8e
Compare
|
/gemini review |
There was a problem hiding this comment.
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.
Description
cloud.google.com/go/storagefromv1.65.1tov1.69.0(which includes googleapis/google-cloud-go#20525 supportingWithReadStallTimeouton gRPC reads) andgithub.com/googleapis/gax-go/v2tov2.26.2.experimental.WithReadStallTimeoutclient option and dynamic delay environment variable configuration (DYNAMIC_READ_REQ_INCREASE_RATEandDYNAMIC_READ_REQ_INITIAL_TIMEOUT) intoaddReadStallTimeoutOptionsininternal/storage/storage_handle.go.addReadStallTimeoutOptionsincreateClientOptionForGRPCClientso that both standard and bidi gRPC storage clients receive the read stall timeout configuration whengcs-retries.read-stall.enableistrue.experimental.WithGRPCBidiReads()calls withstorage.WithGRPCBidiReads()ininternal/storage/storage_handle.goandtools/integration_tests/util/.ReadStallRetryConfigininternal/storage/storage_handle_test.go.Link to the issue in case of a bug fix.
NA
Testing details
cloud.google.com/go/storagev1.69.0.Test_CreateClientOptionForGRPCClient_WithReadStallRetryAddsOneOptionandTestCreateGRPCClientHandle_WithReadStallRetry(go test -v ./internal/storage -run TestStorageHandleTestSuite).Any backward incompatible change? If so, please explain.
No