mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-07-26 04:54:44 +00:00
Merge pull request #15282 from donaldsharp/poll_info
lib: Warn operator when fd limit is set too large
This commit is contained in:
commit
4ec8522ed4
@ -543,6 +543,7 @@ static void initializer(void)
|
|||||||
pthread_key_create(&thread_current, NULL);
|
pthread_key_create(&thread_current, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define STUPIDLY_LARGE_FD_SIZE 100000
|
||||||
struct event_loop *event_master_create(const char *name)
|
struct event_loop *event_master_create(const char *name)
|
||||||
{
|
{
|
||||||
struct event_loop *rv;
|
struct event_loop *rv;
|
||||||
@ -569,6 +570,10 @@ struct event_loop *event_master_create(const char *name)
|
|||||||
rv->fd_limit = (int)limit.rlim_cur;
|
rv->fd_limit = (int)limit.rlim_cur;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (rv->fd_limit > STUPIDLY_LARGE_FD_SIZE)
|
||||||
|
zlog_warn("FD Limit set: %u is stupidly large. Is this what you intended? Consider using --limit-fds",
|
||||||
|
rv->fd_limit);
|
||||||
|
|
||||||
rv->read = XCALLOC(MTYPE_EVENT_POLL,
|
rv->read = XCALLOC(MTYPE_EVENT_POLL,
|
||||||
sizeof(struct event *) * rv->fd_limit);
|
sizeof(struct event *) * rv->fd_limit);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user