This patch fixes the high CPU usage when rsyslog
run out of FDs

reference
http://lists.adiscon.net/pipermail/rsyslog/2013-October/034488.html

Signed-off-by: Mohit Agrawal <[email protected]>
Signed-off-by: Susant Sahani <[email protected]>
---
 plugins/imptcp/imptcp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/plugins/imptcp/imptcp.c b/plugins/imptcp/imptcp.c
index 9dc965b..0c09319 100644
--- a/plugins/imptcp/imptcp.c
+++ b/plugins/imptcp/imptcp.c
@@ -631,7 +631,7 @@ AcceptConnReq(ptcplstn_t *pLstn, int *newSock, prop_t 
**peerName, prop_t **peerI
 
        iNewSock = accept(pLstn->sock, (struct sockaddr*) &addr, &addrlen);
        if(iNewSock < 0) {
-               if(errno == EAGAIN || errno == EWOULDBLOCK)
+               if(errno == EAGAIN || errno == EWOULDBLOCK || errno == EMFILE)
                        ABORT_FINALIZE(RS_RET_NO_MORE_DATA);
                ABORT_FINALIZE(RS_RET_ACCEPT_ERR);
        }
-- 
1.9.3

_______________________________________________
rsyslog mailing list
http://lists.adiscon.net/mailman/listinfo/rsyslog
http://www.rsyslog.com/professional-services/
What's up with rsyslog? Follow https://twitter.com/rgerhards
NOTE WELL: This is a PUBLIC mailing list, posts are ARCHIVED by a myriad of 
sites beyond our control. PLEASE UNSUBSCRIBE and DO NOT POST if you DON'T LIKE 
THAT.

Reply via email to