From 5f28d9bc9edae7ba59aa192380c8c1eaac1d898b Mon Sep 17 00:00:00 2001 From: ja2142 Date: Fri, 14 Feb 2025 00:31:25 +0100 Subject: [PATCH] Let `qlever index` fail if setting the initial `ulimit` fails (#130) The command used by `qlever index` now looks like this: `ulimit -Sn && IndexBuilderMain ...` (so far, the `&&` was a `;`). The default `ulimit` for inputs larger than 10 GB has been reduced from 1048576 to 500000. NOTE: If the reason for a failure was a too large `ulimit`, see https://github.com/ad-freiburg/qlever-control/pull/132 Co-authored-by: Hannah Bast --- src/qlever/commands/index.py | 4 ++-- test/qlever/commands/test_index_execute.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/qlever/commands/index.py b/src/qlever/commands/index.py index 0d1b0b40..eb2fab8d 100644 --- a/src/qlever/commands/index.py +++ b/src/qlever/commands/index.py @@ -236,9 +236,9 @@ def execute(self, args) -> bool: # large number of open files is allowed). total_file_size = get_total_file_size(shlex.split(args.input_files)) if args.ulimit is not None: - index_cmd = f"ulimit -Sn {args.ulimit}; {index_cmd}" + index_cmd = f"ulimit -Sn {args.ulimit} && {index_cmd}" elif total_file_size > 1e10: - index_cmd = f"ulimit -Sn 1048576; {index_cmd}" + index_cmd = f"ulimit -Sn 500000 && {index_cmd}" # Run the command in a container (if so desired). if args.system in Containerize.supported_systems(): diff --git a/test/qlever/commands/test_index_execute.py b/test/qlever/commands/test_index_execute.py index e8004fff..3d4b3b82 100644 --- a/test/qlever/commands/test_index_execute.py +++ b/test/qlever/commands/test_index_execute.py @@ -256,7 +256,7 @@ def test_execute_total_file_size_greater_than_ten_gb( # Assertions expected_index_cmd = ( - f"ulimit -Sn 1048576; {args.cat_input_files} | {args.index_binary}" + f"ulimit -Sn 500000 && {args.cat_input_files} | {args.index_binary}" f" -i {args.name} -s {args.name}.settings.json" f" -F {args.format} -f -" f" | tee {args.name}.index-log.txt"