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>
This commit is contained in:
Rafael Zalamena 2022-02-21 06:28:11 -05:00 committed by Christian Hopps
parent 13a95e5382
commit 673e440770

View File

@ -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();