Skip to content

Commit 7bf8a59

Browse files
committed
Converted IsOpen() function from pure virtual to default virtual function
1 parent 3c8ee9a commit 7bf8a59

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

google/cloud/storage/async/object_descriptor_connection.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ class ObjectDescriptorConnection {
6868
* A descriptor is open if it has not been cancelled and has not hit a
6969
* permanent failure.
7070
*/
71-
virtual bool IsOpen() const = 0;
71+
virtual bool IsOpen() const { return true; }
7272
};
7373

7474
GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END

google/cloud/storage/internal/async/connection_impl.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,10 @@ AsyncConnectionImpl::Open(OpenParams p) {
239239
auto result = f.get();
240240
if (!result) return std::move(result).status();
241241

242+
// The descriptor remains open if at least one gRPC channel is in a
243+
// functional state. We consider READY, IDLE, and CONNECTING to be functional.
244+
// TRANSIENT_FAILURE and SHUTDOWN are not included because they indicate
245+
// a definitive loss of connectivity or terminal closure.
242246
auto transport_ok = [refresh] {
243247
if (!refresh) return true;
244248
auto const& channels = refresh->channels();

0 commit comments

Comments
 (0)