proton: Check for low file descriptor limit.

CW-Bug-Id: #24035
This commit is contained in:
Esme Povirk 2024-07-22 19:43:42 +00:00 committed by Arkadiusz Hiler
parent 4b0d481450
commit b183fae4b7

6
proton
View File

@ -11,6 +11,7 @@ import os
import shutil
import errno
import platform
import resource
import stat
import subprocess
import sys
@ -1464,6 +1465,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: