From fce98161d9815ea016855d9f00274276452c2c4b Mon Sep 17 00:00:00 2001 From: Steve Dickson <steved@redhat.com> Date: Thu, 3 Mar 2016 14:31:08 -0500 Subject: [PATCH 1/1] rendezvous_request: fix endless loop in EMFILE case 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> --- src/svc_vc.c | 16 ++-------------- 1 file 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); } /* -- 1.8.3.1