Skip to content

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

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

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
@Al2Klimov Al2Klimov force-pushed the bugfix/close-ebadf-8437 branch from b3a847d to fa1271d Compare December 14, 2020 12:48
@Al2Klimov Al2Klimov force-pushed the bugfix/close-ebadf-8437 branch from fa1271d to a1bb79c Compare January 11, 2021 16:31
@Al2Klimov Al2Klimov requested a review from julianbrost January 11, 2021 16:31
@Al2Klimov Al2Klimov force-pushed the bugfix/close-ebadf-8437 branch from a1bb79c to 15ceb94 Compare January 11, 2021 16:54
... not to waste time with close(2)ing RLIMIT_NOFILE-3 non-existing FDs.

Newer kernel = higher RLIMIT_NOFILE = more time wasted

refs #8437
@Al2Klimov Al2Klimov requested a review from julianbrost January 12, 2021 16:32
@Al2Klimov Al2Klimov force-pushed the bugfix/close-ebadf-8437 branch from 15ceb94 to 26c9441 Compare January 12, 2021 16:32
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