summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Dickson <steved@redhat.com>2016-03-03 14:31:08 -0500
committerSteve Dickson <steved@redhat.com>2016-03-03 15:52:42 -0500
commitfce98161d9815ea016855d9f00274276452c2c4b (patch)
tree542970e65bc3e2ea7b7aca074ae82521757ba9ba
parent0d4cc7cdc686aa5ef35336f627b09e08b95d52e6 (diff)
downloadti-rpc-fce98161d9815ea016855d9f00274276452c2c4b.tar.gz
rendezvous_request: fix endless loop in EMFILE caselibtirpc-1-0-2-rc2
With the port to poll, and endless loop can be created when we run out of file descriptors. Remove the code that tries to recover from that error Signed-off-by: Steve Dickson <steved@redhat.com>
-rw-r--r--src/svc_vc.c16
1 files changed, 2 insertions, 14 deletions
diff --git a/src/svc_vc.c b/src/svc_vc.c
index 7415244..97a76a3 100644
--- a/src/svc_vc.c
+++ b/src/svc_vc.c
@@ -332,22 +332,10 @@ rendezvous_request(xprt, msg)
r = (struct cf_rendezvous *)xprt->xp_p1;
again:
len = sizeof addr;
- if ((sock = accept(xprt->xp_fd, (struct sockaddr *)(void *)&addr,
- &len)) < 0) {
+ sock = accept(xprt->xp_fd, (struct sockaddr *)(void *)&addr, &len);
+ if (sock < 0) {
if (errno == EINTR)
goto again;
-
- if (errno == EMFILE || errno == ENFILE) {
- /* If there are no file descriptors available, then accept will fail.
- We want to delay here so the connection request can be dequeued;
- otherwise we can bounce between polling and accepting, never
- giving the request a chance to dequeue and eating an enormous
- amount of cpu time in svc_run if we're polling on many file
- descriptors. */
- struct timespec ts = { .tv_sec = 0, .tv_nsec = 50000000 };
- nanosleep (&ts, NULL);
- goto again;
- }
return (FALSE);
}
/*