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

Work around a file descriptor issue in cheroot. #465

Merged
merged 1 commit into from
Jul 13, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions large_image/cache_util/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@
SoftNoFile, HardNoFile = resource.getrlimit(resource.RLIMIT_NOFILE)
resource.setrlimit(resource.RLIMIT_NOFILE, (HardNoFile, HardNoFile))
SoftNoFile, HardNoFile = resource.getrlimit(resource.RLIMIT_NOFILE)
# When run under cheroot, cheroot can fail if the file descriptor is
# greater than 1024 (see github.com/cherrypy/cheroot/issues/249), so
# limit this further
SoftNoFile = min(SoftNoFile, 1024)
# Reserve some file handles for general use, and expect that tile
# sources could use many handles each. This is conservative, since
# running out of file handles breaks the program in general.
Expand Down