summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Dickson <steved@redhat.com>2020-04-22 12:18:43 -0400
committerSteve Dickson <steved@redhat.com>2020-04-27 10:10:14 -0400
commit99f943123d2832cdd0f77c989d82cc8cba26e90b (patch)
treece58eb1e31aa9df9dd335276ebc6c8c3f467390f
parent5c3da4972dbc8ff4cf7cf97b3df0e323af0000be (diff)
downloadti-rpc-99f943123d2832cdd0f77c989d82cc8cba26e90b.tar.gz
__rpc_dtbsize: rlim_cur instead of rlim_maxlibtirpc-1-2-7-rc1
In the client code, rlim_max is used to allocate two arrays used for multithread locking. These arrays are indexed with open file descriptors. With some recent changes to systemd, the rlim_max is now a very large number and no longer represents the max number of open file descriptors allowed causing the locking arrays to be huge resulting in processes being OOM killed. It turns out the max number opens allowed in a process is still fairly small (1023) which means rlim_cur (1024) can be used instead of rlim_max. Signed-off-by: Steve Dickson <steved@redhat.com>
-rw-r--r--src/rpc_generic.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/rpc_generic.c b/src/rpc_generic.c
index 51f36ac..aabbe4b 100644
--- a/src/rpc_generic.c
+++ b/src/rpc_generic.c
@@ -112,7 +112,7 @@ __rpc_dtbsize()
return (tbsize);
}
if (getrlimit(RLIMIT_NOFILE, &rl) == 0) {
- return (tbsize = (int)rl.rlim_max);
+ return (tbsize = (int)rl.rlim_cur);
}
/*
* Something wrong. I'll try to save face by returning a