summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRafael Zalamena <rzalamena@opensourcerouting.org>2022-02-21 06:28:11 -0500
committerChristian Hopps <chopps@labn.net>2022-03-06 07:37:52 -0500
commit673e4407700b90c5ecbbcec5e06fec07fc1149b1 (patch)
tree3f2a151c28e52b7a4838abbcf1e2c23b8b1325cf
parent13a95e53822fbf8fabdd3e16f64af8a9af1fef05 (diff)
lib: tweak northbound gRPC default timeout
Don't let open sockets hang for too long. This will fix an issue where a improperly coded client (e.g. socat) could exaust the amount of open file descriptors. Documentation: https://grpc.github.io/grpc/cpp/md_doc_keepalive.html Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
-rw-r--r--lib/northbound_grpc.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/northbound_grpc.cpp b/lib/northbound_grpc.cpp
index e227d0385c..ecab732e92 100644
--- a/lib/northbound_grpc.cpp
+++ b/lib/northbound_grpc.cpp
@@ -1264,6 +1264,8 @@ static void *grpc_pthread_start(void *arg)
builder.AddListeningPort(server_address.str(),
grpc::InsecureServerCredentials());
builder.RegisterService(service);
+ builder.AddChannelArgument(
+ GRPC_ARG_HTTP2_MIN_RECV_PING_INTERVAL_WITHOUT_DATA_MS, 5000);
auto cq = builder.AddCompletionQueue();
s_cq = cq.get();
s_server = builder.BuildAndStart();