diff options
author | Donald Sharp <sharpd@nvidia.com> | 2021-05-02 13:39:36 +0200 |
---|---|---|
committer | Donald Sharp <sharpd@nvidia.com> | 2021-05-02 13:41:11 +0200 |
commit | 188acbb9a39ef2954b8ac08ed90a41de4fbae8c8 (patch) | |
tree | b83d6eb9abd37a1771c6d9d7565f51b8aaa77fe0 /lib/thread.c | |
parent | Merge pull request #8601 from Fredi-raspall/pr_fix_lfa_debug (diff) | |
download | frr-188acbb9a39ef2954b8ac08ed90a41de4fbae8c8.tar.xz frr-188acbb9a39ef2954b8ac08ed90a41de4fbae8c8.zip |
lib: Provide some better error handling for operator
When an operator encounters a situation where the number
of FD's open is greater than what we have been configured
to legitimately handle via uname or the `--limit-fds` command
line, abort with a message that they should be able to
debug and figure out what is going on.
Fixes: #8596
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Diffstat (limited to 'lib/thread.c')
-rw-r--r-- | lib/thread.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/thread.c b/lib/thread.c index 3d8b54467..7b5d2f311 100644 --- a/lib/thread.c +++ b/lib/thread.c @@ -862,7 +862,10 @@ struct thread *_thread_add_read_write(const struct xref_threadsched *xref, xref->funcname, xref->xref.file, xref->xref.line, t_ptr, fd, 0, arg, 0); - assert(fd >= 0 && fd < m->fd_limit); + assert(fd >= 0); + if (fd >= m->fd_limit) + assert(!"Number of FD's open is greater than FRR currently configured to handle, aborting"); + frr_with_mutex(&m->mtx) { if (t_ptr && *t_ptr) // thread is already scheduled; don't reschedule |