-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
lib, ospfclient, vtysh: Allow for a minimum fd poll size #15320
Conversation
9bedb67
to
a0925ad
Compare
lib/frrevent.h
Outdated
* limit_fds - Ignore the systems built in limit and use 1000 or | ||
* the actual value which ever is lesser | ||
*/ | ||
extern struct event_loop *event_master_create(const char *name, bool limit_fds); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gosh, I'd rather we not change this one api like this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
lib/event.c
Outdated
@@ -544,7 +544,8 @@ static void initializer(void) | |||
} | |||
|
|||
#define STUPIDLY_LARGE_FD_SIZE 100000 | |||
struct event_loop *event_master_create(const char *name) | |||
#define FD_LIMIT_SIZE_FOR_VTYSH 1000 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so "VTYSH" is a little off-target, since there are plenty (dozen?) of non-vtysh places where there can be an issue
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
lib/event.c
Outdated
@@ -570,6 +571,9 @@ struct event_loop *event_master_create(const char *name) | |||
rv->fd_limit = (int)limit.rlim_cur; | |||
} | |||
|
|||
if (limit_fds) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's a problem for any process to try to use an unreasonable number, isn't it? let's make a reasonable default upper limit, and then let someone who really knows what they're doing ask for a bigger number explicitly. like, limit to MIN(fd_setsize, FRRLIMIT), and then exceed that limit only if specifically asked to.
what'd that upper-limit be; what'd make sense for bgp, especially? 10K? 64K?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
There exists cases where just honoring the FD_LIMIT size as given to us by the operating system makes no sense. Let's just make a switch to allow for this for things like vtysh and ospfclient which will never have 1k files open at any given time. Fixes: FRRouting#15315 Signed-off-by: Donald Sharp <[email protected]>
a0925ad
to
729dd6f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I like this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good
There exists cases where just honoring the FD_LIMIT size as given to us by the operating system makes no sense. Let's just make a switch to allow for this for things like vtysh and ospfclient which will never have 1k files open at any given time.
Fixes: #15315