feat(storage): add IsOpen API for zonal read operation#16063
feat(storage): add IsOpen API for zonal read operation#16063v-pratap wants to merge 7 commits intogoogleapis:mainfrom
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces an IsOpen() method to the ObjectDescriptor class and its associated connection interfaces, allowing users to verify if a descriptor is still active and the underlying transport is healthy. The implementation includes gRPC channel state monitoring and updated unit tests. Review feedback highlighted a potential crash in ObjectDescriptorImpl::IsOpen() if the transport callback is null, as well as the risk of calling this callback while holding a mutex. Additionally, the permanent_failure_ field was identified as unused and should be either implemented or removed.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #16063 +/- ##
==========================================
- Coverage 92.70% 92.69% -0.01%
==========================================
Files 2343 2343
Lines 216644 216739 +95
==========================================
+ Hits 200838 200909 +71
- Misses 15806 15830 +24 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| * A descriptor is open if it has not been cancelled and has not hit a | ||
| * permanent failure. | ||
| */ | ||
| virtual bool IsOpen() const { return true; } |
There was a problem hiding this comment.
Should this have a default implementation that returns true or should it be a pure virtual method with no implementation?
There was a problem hiding this comment.
While this is technically correct, users should not need to inherit from this class except in the case of creating mocks for testing. However, we provide such a mock and this PR updates it accordingly. You will need to check in a new abi dump via:
env GOOGLE_CLOUD_CPP_CHECK_API=storage_grpc ci/cloudbuild/build.sh -t check-api-pr
There was a problem hiding this comment.
Running the checkl-api build should have produced a new ci/abi-dumps/google_cloud_cpp_storage_grpc.expected.abi.dump.gz. Add that file to the PR.
There was a problem hiding this comment.


Add IsOpen() to ObjectDescriptor to allow applications to detect if a descriptor is still valid without hanging on a dead connection.
The IsOpen() method returns false if the descriptor has been explicitly cancelled or if all underlying gRPC streams have permanently failed and cannot be resumed. It also incorporates a health check of the underlying gRPC channels.