issue #549: ansible: reduce risk by capping RLIM_INFINITY

pull/612/head
David Wilson 5 years ago
parent 7ca2d00fca
commit edde251d58

@ -246,7 +246,14 @@ def increase_open_file_limit():
limit is much higher. limit is much higher.
""" """
soft, hard = resource.getrlimit(resource.RLIMIT_NOFILE) soft, hard = resource.getrlimit(resource.RLIMIT_NOFILE)
LOG.debug('inherited open file limits: soft=%d hard=%d', soft, hard) if hard == resource.RLIM_INFINITY:
hard_s = '(infinity)'
# cap in case of O(RLIMIT_NOFILE) algorithm in some subprocess.
hard = 524288
else:
hard_s = str(hard)
LOG.debug('inherited open file limits: soft=%d hard=%s', soft, hard_s)
if soft >= hard: if soft >= hard:
LOG.debug('max open files already set to hard limit: %d', hard) LOG.debug('max open files already set to hard limit: %d', hard)
return return

Loading…
Cancel
Save