On Tue, Nov 03, 2015 at 12:15:01AM +0300, Alexander V. Chernikov wrote:
Hi, * Currently, if the number of your established BGP sessions is larger than FD_SETSIZE limit, then you will get 100% cpu usage on select() (returning EINVAL for nfds) after trying to include the first fd>=FD_SETSIZE. Probably, the better way of handling this would be by explicitly rejecting active/passive sockets setup with proper error message so user could rebuild bird with appropriate limit without spending time on diagnosing 100% cpu usage issue.
Hi Thanks for the patch, that makes perfect sense. Will be merged ASAP. BTW, is it possible to change the limit by just redefining it and rebuilding BIRD? Aren't there any problems on the kernel side? Just some minor comment:
diff --git a/sysdep/unix/io.c b/sysdep/unix/io.c if (sk_setup(t) < 0) { /* FIXME: Call err_hook instead ? */ @@ -1404,6 +1415,12 @@ sk_open(sock *s) if (fd < 0) ERR("socket");
+ if (fd >= FD_SETSIZE) + { + log(L_ERR "Socket setup failed due to FD_SETSIZE limit (%d)", FD_SETSIZE); + ERR2("FD_SETSIZE limit reached"); + }
It is unnecessary to do log() here, ERR2() stores the error message in the socket and later it will be logged by the caller using sk_log_error(). -- Elen sila lumenn' omentielvo Ondrej 'Santiago' Zajicek (email: santiago@crfreenet.org) OpenPGP encrypted e-mails preferred (KeyID 0x11DEADC3, wwwkeys.pgp.net) "To err is human -- to blame it on a computer is even more so."