Add "ulimit -a" to eden rage

Summary:
EdenFS has a command eden rage which users run before posting to our Workplace user group. This command collects debugging diagnostics and puts them in a paste. Sometimes, users can have a broken EdenFS instance if their open file limit is misconfigured. Adding the machine's file limit will help our team identify these issues.  Right now, we might have to ask a user to run ulimit -a after we look at their post. This back and forth causes some friction. Adding this information to the rage would remove the need for this back and forth.

The Linux version of the "System load" section was missing a blank line at the end, so I added that.

Reviewed By: xavierd

Differential Revision: D47228835

fbshipit-source-id: 418a224d6277d86e6200ee69d771cf55eb10d4e1
This commit is contained in:
Juan Cruz Lepore 2023-07-07 07:41:30 -07:00 committed by Facebook GitHub Bot
parent 9cc8936f49
commit a3910b896e

View File

@ -234,6 +234,8 @@ def print_diagnostic_info(
print_system_load(out)
print_ulimits(out)
def report_edenfs_bug(instance: EdenInstance, reporter: str) -> None:
rage_lambda: Callable[
@ -506,7 +508,7 @@ def print_system_load(out: IO[bytes]) -> None:
# Limit to the first 16 lines of output because top on CentOS
# doesn't seem to have a command-line flag for this.
output_lines = output.decode("utf-8").split(os.linesep)[:17]
output_lines = output.decode("utf-8").split(os.linesep)[:17] + [""]
elif sys.platform == "darwin":
output = subprocess.check_output(["top", "-l2", "-n10"])
@ -723,3 +725,14 @@ def print_third_party_vscode_extensions(out: IO[bytes]) -> None:
out.write(f"{extension}\n".encode())
if len(problematic_extensions.unsupported) == 0:
out.write(b"None\n")
def print_ulimits(out: IO[bytes]) -> None:
if sys.platform == "win32":
return
try:
section_title("ulimit -a:", out)
output = subprocess.check_output(["ulimit", "-a"])
out.write(output)
except Exception as e:
out.write(f"Error retrieving ulimit values: {e}\n".encode())