From a441af6e289b7c3c75eed2476d26ac776e46046e Mon Sep 17 00:00:00 2001 From: Esme Povirk Date: Mon, 22 Jul 2024 19:43:42 +0000 Subject: [PATCH] proton: Check for low file descriptor limit. CW-Bug-Id: #24035 --- proton | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/proton b/proton index 8bec9466..6f94bdc8 100755 --- a/proton +++ b/proton @@ -9,6 +9,7 @@ import os import shutil import errno import platform +import resource import stat import subprocess import sys @@ -1481,6 +1482,11 @@ class Session: if var in self.env: self.log_file.write("Effective " + var + ": " + self.env[var] + "\n") + # check for low fd limit + _soft_limit, hard_limit = resource.getrlimit(resource.RLIMIT_NOFILE) + if hard_limit < 524288: + self.log_file.write(f"WARNING: Low file descriptor limit: {hard_limit}\n") + self.log_file.write("======================\n") self.log_file.flush() else: