aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/libs/grpc/src/cpp/server/server_builder.cc
diff options
context:
space:
mode:
authorleonidlazarev <leonidlazarev@yandex-team.com>2023-07-17 19:35:29 +0300
committerleonidlazarev <leonidlazarev@yandex-team.com>2023-07-17 19:35:29 +0300
commitcb8e9a6330e4e5d9a0e2f8506e7469bbd641ec63 (patch)
treeeddb7b81e7d1f5a7ac8078591799509e95572f4e /contrib/libs/grpc/src/cpp/server/server_builder.cc
parent029cf29f3669091012394221f00dfa0f3631d91b (diff)
downloadydb-cb8e9a6330e4e5d9a0e2f8506e7469bbd641ec63.tar.gz
feat grpc: update to grpc 1.53.1
update grpc to 1.53.1 update grpcio/py3 to 1.53.1 Added patches: 22-grpc-code-output.patch - allow translation of grpc code to internal string type. 23-max-thread-limitation.patch - to provide interface for settings of thread number limit, as grpc::DynamicThreadPool doesn't provide interface to limit thread number anymore. 24-support_for-non-abort-grpc.patch - generate exception instead of application crash 25-forkable-destruction-order.patch - correct forkable logic for TimerManager 27-skip-child-post-fork-operations.patch - allow to skip child post fork operations to exclude UB (used for unified agent only) pr33495_fox_nested_fork.patch - fix issues with nested forks pr33582_fork_handler.patch - disable fork handler support if it is not requested intentionally
Diffstat (limited to 'contrib/libs/grpc/src/cpp/server/server_builder.cc')
-rw-r--r--contrib/libs/grpc/src/cpp/server/server_builder.cc57
1 files changed, 27 insertions, 30 deletions
diff --git a/contrib/libs/grpc/src/cpp/server/server_builder.cc b/contrib/libs/grpc/src/cpp/server/server_builder.cc
index 9b30a4c7230..92a06dfd58e 100644
--- a/contrib/libs/grpc/src/cpp/server/server_builder.cc
+++ b/contrib/libs/grpc/src/cpp/server/server_builder.cc
@@ -1,27 +1,26 @@
-/*
- *
- * Copyright 2015-2016 gRPC authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
+//
+//
+// Copyright 2015-2016 gRPC authors.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+//
#include <limits.h>
#include <stdint.h>
#include <string.h>
#include <algorithm>
-#include <iterator>
#include <memory>
#include <util/generic/string.h>
#include <util/string/cast.h>
@@ -29,13 +28,11 @@
#include <vector>
#include <grpc/grpc.h>
-#include <grpc/impl/codegen/compression_types.h>
-#include <grpc/impl/codegen/grpc_types.h>
+#include <grpc/impl/compression_types.h>
#include <grpc/support/log.h>
#include <grpc/support/sync.h>
#include <grpc/support/workaround_list.h>
#include <grpcpp/completion_queue.h>
-#include <grpcpp/impl/codegen/server_interface.h>
#include <grpcpp/impl/server_builder_option.h>
#include <grpcpp/impl/server_builder_plugin.h>
#include <grpcpp/impl/service_type.h>
@@ -45,8 +42,8 @@
#include <grpcpp/server.h>
#include <grpcpp/server_builder.h>
#include <grpcpp/server_context.h>
+#include <grpcpp/server_interface.h>
#include <grpcpp/support/channel_arguments.h>
-#include <grpcpp/support/config.h>
#include <grpcpp/support/server_interceptor.h>
#include "src/core/lib/gpr/string.h"
@@ -161,6 +158,13 @@ void ServerBuilder::experimental_type::SetAuthorizationPolicyProvider(
builder_->authorization_provider_ = std::move(provider);
}
+void ServerBuilder::experimental_type::EnableCallMetricRecording(
+ experimental::ServerMetricRecorder* server_metric_recorder) {
+ builder_->AddChannelArgument(GRPC_ARG_SERVER_CALL_METRIC_RECORDING, 1);
+ GPR_ASSERT(builder_->server_metric_recorder_ == nullptr);
+ builder_->server_metric_recorder_ = server_metric_recorder;
+}
+
ServerBuilder& ServerBuilder::SetOption(
std::unique_ptr<ServerBuilderOption> option) {
options_.push_back(std::move(option));
@@ -358,18 +362,11 @@ std::unique_ptr<grpc::Server> ServerBuilder::BuildAndStart() {
gpr_log(GPR_INFO, "Callback server.");
}
- // Merge the application and internal interceptors together.
- // Internal interceptors go first.
- auto creators = std::move(internal_interceptor_creators_);
- creators.insert(creators.end(),
- std::make_move_iterator(interceptor_creators_.begin()),
- std::make_move_iterator(interceptor_creators_.end()));
-
std::unique_ptr<grpc::Server> server(new grpc::Server(
&args, sync_server_cqs, sync_server_settings_.min_pollers,
sync_server_settings_.max_pollers, sync_server_settings_.cq_timeout_msec,
std::move(acceptors_), server_config_fetcher_, resource_quota_,
- std::move(creators)));
+ std::move(interceptor_creators_), server_metric_recorder_));
ServerInitializer* initializer = server->initializer();