Skip to content

Commit

Permalink
Let qlever index fail if setting the initial ulimit fails (#130)
Browse files Browse the repository at this point in the history
The command used by `qlever index` now looks like this: `ulimit -Sn <ulimit> && 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 #132

Co-authored-by: Hannah Bast <[email protected]>
  • Loading branch information
ja2142 and Hannah Bast authored Feb 13, 2025
1 parent d65235b commit 5f28d9b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/qlever/commands/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down
2 changes: 1 addition & 1 deletion test/qlever/commands/test_index_execute.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 5f28d9b

Please sign in to comment.