From 8dfee39235c525dbd254968beee54f9eaa749e74 Mon Sep 17 00:00:00 2001 From: v-pratap Date: Mon, 10 Nov 2025 07:06:31 +0000 Subject: [PATCH 1/6] race-condition-test-1 --- .../cloud/storage/internal/async/writer_connection_resumed.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/google/cloud/storage/internal/async/writer_connection_resumed.cc b/google/cloud/storage/internal/async/writer_connection_resumed.cc index 3f467d0ed7eb3..133287f726f53 100644 --- a/google/cloud/storage/internal/async/writer_connection_resumed.cc +++ b/google/cloud/storage/internal/async/writer_connection_resumed.cc @@ -113,7 +113,7 @@ class AsyncWriterConnectionResumedState resend_buffer_.Append(WritePayloadImpl::GetImpl(p)); finalize_ = true; HandleNewData(std::move(lk)); - // Return the unique future associated with this finalization. + // Returns the unique future associated with this finalization. return std::move(finalized_future_); } From bbfb641814050f36aee90a1e2968764a55c23da7 Mon Sep 17 00:00:00 2001 From: v-pratap Date: Mon, 10 Nov 2025 07:22:17 +0000 Subject: [PATCH 2/6] test-2 --- google/cloud/storage/internal/async/writer_connection_resumed.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/google/cloud/storage/internal/async/writer_connection_resumed.cc b/google/cloud/storage/internal/async/writer_connection_resumed.cc index 133287f726f53..61564d1a52a85 100644 --- a/google/cloud/storage/internal/async/writer_connection_resumed.cc +++ b/google/cloud/storage/internal/async/writer_connection_resumed.cc @@ -184,6 +184,7 @@ class AsyncWriterConnectionResumedState } void WriteLoop(std::unique_lock lk) { + std::cout << "Hey this is a test statement of new branch.\n"; // Determine if there's data left to write *before* potentially finalizing. writing_ = write_offset_ < resend_buffer_.size(); From a33f8fe118867629dbb9ea899aeeab04513318e7 Mon Sep 17 00:00:00 2001 From: v-pratap Date: Mon, 10 Nov 2025 07:27:01 +0000 Subject: [PATCH 3/6] test-3 --- .../cloud/storage/internal/async/writer_connection_resumed.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/google/cloud/storage/internal/async/writer_connection_resumed.cc b/google/cloud/storage/internal/async/writer_connection_resumed.cc index 61564d1a52a85..26c7510b6a66b 100644 --- a/google/cloud/storage/internal/async/writer_connection_resumed.cc +++ b/google/cloud/storage/internal/async/writer_connection_resumed.cc @@ -184,7 +184,7 @@ class AsyncWriterConnectionResumedState } void WriteLoop(std::unique_lock lk) { - std::cout << "Hey this is a test statement of new branch.\n"; + std::cerr << "Hey this is a test statement of new branch.\n"; // Determine if there's data left to write *before* potentially finalizing. writing_ = write_offset_ < resend_buffer_.size(); From 6e365c940e84dcb52cc0bc12d563e005e2476ad7 Mon Sep 17 00:00:00 2001 From: v-pratap Date: Mon, 10 Nov 2025 09:00:49 +0000 Subject: [PATCH 4/6] test-5 --- google/cloud/storage/async/client.cc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/google/cloud/storage/async/client.cc b/google/cloud/storage/async/client.cc index 509b6294a7a96..e30cf655865d3 100644 --- a/google/cloud/storage/async/client.cc +++ b/google/cloud/storage/async/client.cc @@ -52,6 +52,7 @@ future> AsyncClient::InsertObject( future> AsyncClient::Open( BucketName const& bucket_name, std::string object_name, Options opts) { auto spec = google::storage::v2::BidiReadObjectSpec{}; + std::cerr << "Hey this is a test statement of new branch.\n"; spec.set_bucket(bucket_name.FullName()); spec.set_object(std::move(object_name)); return Open(std::move(spec), std::move(opts)); @@ -59,7 +60,8 @@ future> AsyncClient::Open( future> AsyncClient::Open( google::storage::v2::BidiReadObjectSpec spec, Options opts) { - return connection_ + std::cerr << "Hey this is a test statement of new branch.\n"; + return connection_ ->Open({std::move(spec), internal::MergeOptions(std::move(opts), connection_->options())}) .then([](auto f) -> StatusOr { @@ -116,7 +118,8 @@ future>> AsyncClient::StartAppendableObjectUpload(BucketName const& bucket_name, std::string object_name, Options opts) { - auto request = google::storage::v2::BidiWriteObjectRequest{}; + std::cerr << "Hey this is a test statement of new branch.\n"; + auto request = google::storage::v2::BidiWriteObjectRequest{}; auto& resource = *request.mutable_write_object_spec()->mutable_resource(); resource.set_bucket(BucketName(bucket_name).FullName()); @@ -129,7 +132,8 @@ AsyncClient::StartAppendableObjectUpload(BucketName const& bucket_name, future>> AsyncClient::StartAppendableObjectUpload( google::storage::v2::BidiWriteObjectRequest request, Options opts) { - return connection_ + std::cerr << "Hey this is a test statement of new branch.\n"; + return connection_ ->StartAppendableObjectUpload( {std::move(request), internal::MergeOptions(std::move(opts), connection_->options())}) From 8cd7f96672725009a7b2bce46ecd953ba0b0d02a Mon Sep 17 00:00:00 2001 From: v-pratap Date: Thu, 20 Nov 2025 12:05:26 +0000 Subject: [PATCH 5/6] test -05 --- .../storage/internal/async/writer_connection_resumed.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/google/cloud/storage/internal/async/writer_connection_resumed.cc b/google/cloud/storage/internal/async/writer_connection_resumed.cc index 26c7510b6a66b..ebae1267878e5 100644 --- a/google/cloud/storage/internal/async/writer_connection_resumed.cc +++ b/google/cloud/storage/internal/async/writer_connection_resumed.cc @@ -257,8 +257,8 @@ class AsyncWriterConnectionResumedState auto impl = Impl(lk); lk.unlock(); impl->Query().then([this, result, w = WeakFromThis()](auto f) { - SetFlushed(std::unique_lock(mu_), std::move(result)); if (auto self = w.lock()) return self->OnQuery(f.get()); + SetFlushed(std::unique_lock(mu_), std::move(result)); }); } @@ -464,8 +464,8 @@ class AsyncWriterConnectionResumedState flushed.set_value(result); // Restart the write loop ONLY if we are not already finalizing. // If finalizing_ is true, the completion will be handled by OnFinalize. - std::unique_lock loop_lk(mu_); - if (!finalizing_) WriteLoop(std::move(loop_lk)); + // std::unique_lock loop_lk(mu_); + // if (!finalizing_) WriteLoop(std::move(loop_lk)); } void SetError(std::unique_lock lk, Status const& status) { From fa02b42c8380a1174d4aa0b8876988e9374cb344 Mon Sep 17 00:00:00 2001 From: v-pratap Date: Fri, 21 Nov 2025 07:02:59 +0000 Subject: [PATCH 6/6] test-06 --- google/cloud/storage/async/client.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/google/cloud/storage/async/client.cc b/google/cloud/storage/async/client.cc index e30cf655865d3..f644592fa5455 100644 --- a/google/cloud/storage/async/client.cc +++ b/google/cloud/storage/async/client.cc @@ -133,6 +133,9 @@ future>> AsyncClient::StartAppendableObjectUpload( google::storage::v2::BidiWriteObjectRequest request, Options opts) { std::cerr << "Hey this is a test statement of new branch.\n"; + return make_ready_future( + StatusOr>(Status( + StatusCode::kInternal, "msg"))); return connection_ ->StartAppendableObjectUpload( {std::move(request),