Skip to content

Commit a3b679f

Browse files
committed
refresh stub before retry loop
1 parent 2ceb869 commit a3b679f

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

google/cloud/bigtable/internal/data_connection_impl.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -924,18 +924,18 @@ future<StatusOr<bigtable::PreparedQuery>> DataConnectionImpl::AsyncPrepareQuery(
924924
auto backoff = backoff_policy(*current);
925925
auto operation_context = operation_context_factory_->PrepareQuery(
926926
request.instance_name(), app_profile_id(*current));
927+
// Get a new stub here to take advantage of the pool.
928+
auto stub = stub_manager_->GetStub(instance_name);
927929
return google::cloud::internal::AsyncRetryLoop(
928930
std::move(retry), std::move(backoff),
929931
Idempotency::kIdempotent, background_->cq(),
930-
[this, instance_name, operation_context](
932+
[stub, instance_name, operation_context](
931933
CompletionQueue& cq,
932934
std::shared_ptr<grpc::ClientContext> context,
933935
google::cloud::internal::ImmutableOptions options,
934936
google::bigtable::v2::PrepareQueryRequest const&
935937
request) {
936938
operation_context->PreCall(*context);
937-
// Get a new stub here to take advantage of the pool.
938-
auto stub = stub_manager_->GetStub(instance_name);
939939
auto f = stub->AsyncPrepareQuery(
940940
cq, context, std::move(options), request);
941941
return f.then([operation_context,

0 commit comments

Comments
 (0)