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

Delete recommendations to mount fdescfs #39

Closed
asomers opened this issue Oct 9, 2024 · 0 comments · Fixed by #40
Closed

Delete recommendations to mount fdescfs #39

asomers opened this issue Oct 9, 2024 · 0 comments · Fixed by #40
Assignees
Labels
documentation Improvements or additions to documentation

Comments

@asomers
Copy link
Member

asomers commented Oct 9, 2024

iocage recommends the user to mount fdescfs if it isn't already mounted. AFAIK, this is due to a Python performance bug. It used to be that when Python exec'd a new process, it would iterate through all possible file descriptors, closing each one, before calling exec. That can take a very long time with high ulimit -n. Then Python learned to look in fdescfs to see how many file descriptors were actually open. Big improvement. But still a hack. Now, Python will use the closefrom syscall to close all file descriptors at once. Best solution! Since all currently supported versions of Python have that change, iocage should remove the recommendation to mount fdescfs.

freebsd/freebsd-ports@e4c2b30 applied the patch to FreeBSD's Python packages, and
python/cpython@162c567 applied the patch to the main Python repository.

If you use FreeBSD's Python packages, the minimum versions containing the fix are 3.8.1_2, 3.7.5_1, 3.6.9_1, 3.5.9_3, or 2.7.17_1

Original issue: iocage/iocage#1234

asomers added a commit to asomers/iocage that referenced this issue Oct 9, 2024
fdescfs used to be useful to help Python more quickly close file
descriptors before exec().  But for years, Python has been using
closefrom() instead.  All versions of Python 3.9 and later do that.

Fixes freebsd#39
@dgeo dgeo added the documentation Improvements or additions to documentation label Oct 14, 2024
@dgeo dgeo self-assigned this Oct 14, 2024
@dgeo dgeo closed this as completed in #40 Oct 14, 2024
dgeo pushed a commit that referenced this issue Oct 14, 2024
fdescfs used to be useful to help Python more quickly close file
descriptors before exec().  But for years, Python has been using
closefrom() instead.  All versions of Python 3.9 and later do that.

Fixes #39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants