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

Close FDs based on /proc/self/fd #8442

Merged
merged 1 commit into from
Jan 13, 2021
Merged

Close FDs based on /proc/self/fd #8442

merged 1 commit into from
Jan 13, 2021

Conversation

Al2Klimov
Copy link
Member

@Al2Klimov Al2Klimov commented Nov 5, 2020

... not to waste time with close(2)ing RLIMIT_NOFILE-3 non-existing FDs.

Newer kernel = higher RLIMIT_NOFILE = more time wasted

fixes #8437

@icinga-probot icinga-probot bot added this to the 2.13.0 milestone Nov 5, 2020
@icinga-probot icinga-probot bot added the bug Something isn't working label Nov 5, 2020
@Al2Klimov
Copy link
Member Author

# strace -f -e trace=close icinga2 daemon 230</dev/null 420</dev/null
close(230)                              = 0
close(420)                              = 0

@Al2Klimov Al2Klimov marked this pull request as ready for review November 5, 2020 14:56
lib/base/utility.hpp Outdated Show resolved Hide resolved
icinga-app/icinga.cpp Show resolved Hide resolved
lib/base/utility.hpp Outdated Show resolved Hide resolved
lib/base/utility.hpp Outdated Show resolved Hide resolved
lib/base/utility.hpp Outdated Show resolved Hide resolved
lib/base/utility.hpp Outdated Show resolved Hide resolved
lib/base/utility.hpp Outdated Show resolved Hide resolved
... not to waste time with close(2)ing RLIMIT_NOFILE-3 non-existing FDs.

Newer kernel = higher RLIMIT_NOFILE = more time wasted

refs #8437
Copy link
Contributor

@julianbrost julianbrost left a comment

Choose a reason for hiding this comment

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

Given that you have written special code for Apple, I assume you have tested there, as I can't do that.

@Al2Klimov Al2Klimov merged commit 5a0118c into master Jan 13, 2021
@icinga-probot icinga-probot bot deleted the bugfix/close-ebadf-8437 branch January 13, 2021 09:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Million(s) of calls to close(*) = -1 EBADF (Bad file descriptor)
2 participants