[PATCH] D97536: [clangd][remote] Add flag to set idletimeout
Kadir Cetinkaya via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Feb 26 02:07:02 PST 2021
kadircet updated this revision to Diff 326632.
kadircet marked an inline comment as done.
kadircet added a comment.
Change 10 seconds to 600 seconds.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D97536/new/
https://reviews.llvm.org/D97536
Files:
clang-tools-extra/clangd/index/remote/server/Server.cpp
Index: clang-tools-extra/clangd/index/remote/server/Server.cpp
===================================================================
--- clang-tools-extra/clangd/index/remote/server/Server.cpp
+++ clang-tools-extra/clangd/index/remote/server/Server.cpp
@@ -80,6 +80,11 @@
"server-address", llvm::cl::init("0.0.0.0:50051"),
llvm::cl::desc("Address of the invoked server. Defaults to 0.0.0.0:50051"));
+llvm::cl::opt<size_t> IdleTimeoutSeconds(
+ "idle-timeout", llvm::cl::init(10 * 60),
+ llvm::cl::desc("Maximum time a channel may stay idle until server closes "
+ "the connection, in seconds. Defaults to 600."));
+
static Key<grpc::ServerContext *> CurrentRequest;
class RemoteIndexServer final : public v1::SymbolIndex::Service {
@@ -311,6 +316,8 @@
grpc::ServerBuilder Builder;
Builder.AddListeningPort(ServerAddress.str(),
grpc::InsecureServerCredentials());
+ Builder.AddChannelArgument(GRPC_ARG_MAX_CONNECTION_IDLE_MS,
+ IdleTimeoutSeconds * 1000);
Builder.RegisterService(&Service);
std::unique_ptr<grpc::Server> Server(Builder.BuildAndStart());
log("Server listening on {0}", ServerAddress);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D97536.326632.patch
Type: text/x-patch
Size: 1211 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210226/563d9d07/attachment.bin>
More information about the cfe-commits
mailing list