diff options
author | Steve Dickson <steved@redhat.com> | 2016-03-03 14:31:08 -0500 |
---|---|---|
committer | Steve Dickson <steved@redhat.com> | 2016-03-03 15:52:42 -0500 |
commit | fce98161d9815ea016855d9f00274276452c2c4b (patch) | |
tree | 542970e65bc3e2ea7b7aca074ae82521757ba9ba /src/svc_vc.c | |
parent | 0d4cc7cdc686aa5ef35336f627b09e08b95d52e6 (diff) | |
download | ti-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>
Diffstat (limited to 'src/svc_vc.c')
-rw-r--r-- | src/svc_vc.c | 16 |
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); } /* |