[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 06:05:19 PST 2021
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG1a5dfb7db23e: [clangd][remote] Add flag to set idletimeout (authored by kadircet).
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(8 * 60),
+ llvm::cl::desc("Maximum time a channel may stay idle until server closes "
+ "the connection, in seconds. Defaults to 480."));
+
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.326672.patch
Type: text/x-patch
Size: 1210 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210226/6a6b3570/attachment-0001.bin>
More information about the cfe-commits
mailing list