Change Idd98c183eca3e2df8648fc0f37d27fe9cc6d0563 stopped closing
filedescriptors beyond the sensible_fd_limit. With this patch
the previous behavior is restored. We can close the fds more efficiently
by just iterating over /proc/self/fd on Linux and only change
the rlimit/MAXFD setting when successful.
Change-Id: I3b481ddd14ae2b948270d715aad157cf3996def7
The use of the "resource" module now prevents oslo.rootwrap from
being imported on Windows.
Although oslo.rootwrap is not effectively used on Windows, it's
important for it to at least be importable, since it's widely
used throughout OpenStack projects without having platform checks
in place.
This change checks if the "resource" module is avaialble before
attempting to use it.
Change-Id: I2391315f77718a3c9eb9fc8c03a6882237f33548
Closes-Bug: #1804639
On Python 2.x, a subprocess.Popen() with close_fds=True will
fork and then close filedescriptors range(3..os.sysconf("SC_OPEN_MAX")),
which thanks to Kernel PTI (Kaiser patches) is significantly slower
in 2018 when the range is very large. With a soft limit of 1048576,
benchmark.py reports an overhead of ~ 400ms without this patch and 2ms
with the patch applied. This patch adds a configuration option and
sets a more sensible default of 1024 file descriptor limit by default.
Closes-Bug: 1796267
Change-Id: Idd98c183eca3e2df8648fc0f37d27fe9cc6d0563
Move the import to the spot where we really need it. This
speeds up the command line invocation (non-daemon) a bit.
Closes-Bug: #1440744
Change-Id: I401c290e0b61912b5dce106d3fdda91795a8cb12
Move the public API out of oslo.rootwrap to oslo_rootwrap. Retain
the ability to import from the old namespace package for backwards
compatibility for this release cycle.
bp/drop-namespace-packages
Change-Id: Ifed1a99e5ea6d999760731867c4294707698d41c