Skip to content
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

Merged
merged 1 commit into from
Feb 13, 2024

Conversation

donaldsharp
Copy link
Member

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

@frrbot frrbot bot added the tests Topotests, make check, etc label Feb 7, 2024
@github-actions github-actions bot added size/M and removed size/S labels Feb 7, 2024
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);
Copy link
Contributor

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

Copy link
Member Author

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
Copy link
Contributor

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

Copy link
Member Author

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)
Copy link
Contributor

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?

Copy link
Member Author

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]>
Copy link
Contributor

@mjstapp mjstapp left a 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.

Copy link
Member

@riw777 riw777 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good

@riw777 riw777 merged commit e74c3b0 into FRRouting:master Feb 13, 2024
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

vtysh failed to allocate 8589934528 bytes for Thread Poll Info object
3 participants