aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/libs/grpc/include/grpcpp/server.h
diff options
context:
space:
mode:
authorarcadia-devtools <arcadia-devtools@yandex-team.ru>2022-03-15 21:33:41 +0300
committerarcadia-devtools <arcadia-devtools@yandex-team.ru>2022-03-15 21:33:41 +0300
commit3dd665b514943f69657b593eb51af90b99b1206b (patch)
tree0eb633e628bb1fe6c639574b1184d43def7c0a73 /contrib/libs/grpc/include/grpcpp/server.h
parenta68afc731202027f105bc5723ee11788017c29e2 (diff)
downloadydb-3dd665b514943f69657b593eb51af90b99b1206b.tar.gz
intermediate changes
ref:953ca886ec160075b38c0f3614de029b423f0a9e
Diffstat (limited to 'contrib/libs/grpc/include/grpcpp/server.h')
-rw-r--r--contrib/libs/grpc/include/grpcpp/server.h40
1 files changed, 29 insertions, 11 deletions
diff --git a/contrib/libs/grpc/include/grpcpp/server.h b/contrib/libs/grpc/include/grpcpp/server.h
index ff04746347..06e6e80e5b 100644
--- a/contrib/libs/grpc/include/grpcpp/server.h
+++ b/contrib/libs/grpc/include/grpcpp/server.h
@@ -62,13 +62,13 @@ class ExternalConnectionAcceptorImpl;
/// \a Server instances.
class Server : public ServerInterface, private GrpcLibraryCodegen {
public:
- ~Server();
+ ~Server() Y_ABSL_LOCKS_EXCLUDED(mu_) override;
/// Block until the server shuts down.
///
/// \warning The server must be either shutting down or some other thread must
/// call \a Shutdown for this function to ever return.
- void Wait() override;
+ void Wait() Y_ABSL_LOCKS_EXCLUDED(mu_) override;
/// Global callbacks are a set of hooks that are called when server
/// events occur. \a SetGlobalCallbacks method is used to register
@@ -137,7 +137,7 @@ class Server : public ServerInterface, private GrpcLibraryCodegen {
protected:
/// Register a service. This call does not take ownership of the service.
/// The service must exist for the lifetime of the Server instance.
- bool RegisterService(const TString* host, Service* service) override;
+ bool RegisterService(const TString* addr, Service* service) override;
/// Try binding the server to the given \a addr endpoint
/// (port, and optionally including IP address to bind to).
@@ -183,6 +183,7 @@ class Server : public ServerInterface, private GrpcLibraryCodegen {
int min_pollers, int max_pollers, int sync_cq_timeout_msec,
std::vector<std::shared_ptr<internal::ExternalConnectionAcceptorImpl>>
acceptors,
+ grpc_server_config_fetcher* server_config_fetcher = nullptr,
grpc_resource_quota* server_rq = nullptr,
std::vector<
std::unique_ptr<experimental::ServerInterceptorFactoryInterface>>
@@ -206,6 +207,8 @@ class Server : public ServerInterface, private GrpcLibraryCodegen {
health_check_service_ = std::move(service);
}
+ ContextAllocator* context_allocator() { return context_allocator_.get(); }
+
/// NOTE: This method is not part of the public API for this class.
bool health_check_service_disabled() const {
return health_check_service_disabled_;
@@ -243,6 +246,12 @@ class Server : public ServerInterface, private GrpcLibraryCodegen {
/// ownership of theservice. The service must exist for the lifetime of the
/// Server instance.
void RegisterCallbackGenericService(CallbackGenericService* service) override;
+
+ void RegisterContextAllocator(
+ std::unique_ptr<ContextAllocator> context_allocator) {
+ context_allocator_ = std::move(context_allocator);
+ }
+
#else
/// NOTE: class experimental_registration_type is not part of the public API
/// of this class
@@ -257,6 +266,11 @@ class Server : public ServerInterface, private GrpcLibraryCodegen {
server_->RegisterCallbackGenericService(service);
}
+ void RegisterContextAllocator(
+ std::unique_ptr<ContextAllocator> context_allocator) override {
+ server_->context_allocator_ = std::move(context_allocator);
+ }
+
private:
Server* server_;
};
@@ -276,13 +290,14 @@ class Server : public ServerInterface, private GrpcLibraryCodegen {
void PerformOpsOnCall(internal::CallOpSetInterface* ops,
internal::Call* call) override;
- void ShutdownInternal(gpr_timespec deadline) override;
+ void ShutdownInternal(gpr_timespec deadline)
+ Y_ABSL_LOCKS_EXCLUDED(mu_) override;
int max_receive_message_size() const override {
return max_receive_message_size_;
}
- CompletionQueue* CallbackCQ() override;
+ CompletionQueue* CallbackCQ() Y_ABSL_LOCKS_EXCLUDED(mu_) override;
ServerInitializer* initializer();
@@ -290,8 +305,8 @@ class Server : public ServerInterface, private GrpcLibraryCodegen {
// the ref count are the running state of the server (take a ref at start and
// drop it at shutdown) and each running callback RPC.
void Ref();
- void UnrefWithPossibleNotify() /* LOCKS_EXCLUDED(mu_) */;
- void UnrefAndWaitLocked() /* EXCLUSIVE_LOCKS_REQUIRED(mu_) */;
+ void UnrefWithPossibleNotify() Y_ABSL_LOCKS_EXCLUDED(mu_);
+ void UnrefAndWaitLocked() Y_ABSL_EXCLUSIVE_LOCKS_REQUIRED(mu_);
std::vector<std::shared_ptr<internal::ExternalConnectionAcceptorImpl>>
acceptors_;
@@ -325,10 +340,11 @@ class Server : public ServerInterface, private GrpcLibraryCodegen {
// Server status
internal::Mutex mu_;
bool started_;
- bool shutdown_;
- bool shutdown_notified_; // Was notify called on the shutdown_cv_
+ bool shutdown_ Y_ABSL_GUARDED_BY(mu_);
+ bool shutdown_notified_
+ Y_ABSL_GUARDED_BY(mu_); // Was notify called on the shutdown_cv_
internal::CondVar shutdown_done_cv_;
- bool shutdown_done_ = false;
+ bool shutdown_done_ Y_ABSL_GUARDED_BY(mu_) = false;
std::atomic_int shutdown_refs_outstanding_{1};
internal::CondVar shutdown_cv_;
@@ -345,6 +361,8 @@ class Server : public ServerInterface, private GrpcLibraryCodegen {
std::unique_ptr<ServerInitializer> server_initializer_;
+ std::unique_ptr<ContextAllocator> context_allocator_;
+
std::unique_ptr<HealthCheckServiceInterface> health_check_service_;
bool health_check_service_disabled_;
@@ -366,7 +384,7 @@ class Server : public ServerInterface, private GrpcLibraryCodegen {
// with this server (if any). It is set on the first call to CallbackCQ().
// It is _not owned_ by the server; ownership belongs with its internal
// shutdown callback tag (invoked when the CQ is fully shutdown).
- CompletionQueue* callback_cq_ /* GUARDED_BY(mu_) */ = nullptr;
+ CompletionQueue* callback_cq_ Y_ABSL_GUARDED_BY(mu_) = nullptr;
// List of CQs passed in by user that must be Shutdown only after Server is
// Shutdown. Even though this is only used with NDEBUG, instantiate it in all