aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/libs/grpc/src/cpp/server/server_cc.cc
diff options
context:
space:
mode:
authorDaniil Cherednik <dan.cherednik@gmail.com>2023-03-31 10:54:08 +0300
committerDaniil Cherednik <dan.cherednik@gmail.com>2023-03-31 12:28:07 +0300
commitfc1cffcfa7f0497a1f97b384a24bcbf23362f3be (patch)
treec15f7ab5b9e9b20fd0ef8fc07d598d28e8b32004 /contrib/libs/grpc/src/cpp/server/server_cc.cc
parent8a749596d40e91c896a1907afcd108d9221fbde1 (diff)
downloadydb-fc1cffcfa7f0497a1f97b384a24bcbf23362f3be.tar.gz
Ydb stable 23-1-1923.1.19
x-stable-origin-commit: c5d5a396e89d0a72e0267a55e93d8404d4fb54fe
Diffstat (limited to 'contrib/libs/grpc/src/cpp/server/server_cc.cc')
-rw-r--r--contrib/libs/grpc/src/cpp/server/server_cc.cc23
1 files changed, 16 insertions, 7 deletions
diff --git a/contrib/libs/grpc/src/cpp/server/server_cc.cc b/contrib/libs/grpc/src/cpp/server/server_cc.cc
index edb1fe4d1d..02a52263c9 100644
--- a/contrib/libs/grpc/src/cpp/server/server_cc.cc
+++ b/contrib/libs/grpc/src/cpp/server/server_cc.cc
@@ -225,17 +225,24 @@ void ServerInterface::RegisteredAsyncRequest::IssueRequest(
ServerInterface::GenericAsyncRequest::GenericAsyncRequest(
ServerInterface* server, GenericServerContext* context,
internal::ServerAsyncStreamingInterface* stream, CompletionQueue* call_cq,
- ServerCompletionQueue* notification_cq, void* tag, bool delete_on_finalize)
+ ServerCompletionQueue* notification_cq, void* tag, bool delete_on_finalize,
+ bool delay_start)
: BaseAsyncRequest(server, context, stream, call_cq, notification_cq, tag,
delete_on_finalize) {
grpc_call_details_init(&call_details_);
- GPR_ASSERT(notification_cq);
- GPR_ASSERT(call_cq);
+ if (!delay_start) {
+ Start();
+ }
+}
+
+void ServerInterface::GenericAsyncRequest::Start() {
+ GPR_ASSERT(notification_cq_);
+ GPR_ASSERT(call_cq_);
// The following call_start_batch is internally-generated so no need for an
// explanatory log on failure.
- GPR_ASSERT(grpc_server_request_call(server->server(), &call_, &call_details_,
- context->client_metadata_.arr(),
- call_cq->cq(), notification_cq->cq(),
+ GPR_ASSERT(grpc_server_request_call(server_->server(), &call_, &call_details_,
+ context_->client_metadata_.arr(),
+ call_cq_->cq(), notification_cq_->cq(),
this) == GRPC_CALL_OK);
}
@@ -303,7 +310,9 @@ class Server::UnimplementedAsyncRequest final
UnimplementedAsyncRequest(ServerInterface* server,
grpc::ServerCompletionQueue* cq)
: GenericAsyncRequest(server, &server_context_, &generic_stream_, cq, cq,
- nullptr, false) {}
+ nullptr, false, true) {
+ Start();
+ }
bool FinalizeResult(void** tag, bool* status) override;