Detect arguments that would exceed limits, attempt to raise limits, and fail early if not possible
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 42/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- c
- Domain
- cli, operating-systems
Research direction
Start by tracing how command-line arguments determine the number of input files and where file descriptors are opened. Review the POSIX getrlimit and setrlimit behavior described in the issue, then check the existing error paths for resource-limit failures. Done means limits are checked and raised when possible, with a clear error status and message when they cannot support the requested inputs.
Written by the indexing model from the issue text.
Description
There have been a couple of issues (#119, #329) that ended up being an issue with OS resource limits on the number of open files, but this was not obvious to the users because bcftools did not report a useful error message.
In addition to reporting the error at the time it occurs I think it would be useful to add a new feature that would check system limits (i.e. with getrlimit on POSIX systems) against the number of file descriptors that appear to be necessary based on the command-line arguments, and if the need is greater than the limit, attempt to raise the limit (i.e. with setrlimit). If the limit is not high enough and cannot be raised, bcftools should exit with an error status and print a clear message as to what the problem is (e.g. "Processing will require 1503 open file descriptors, but limit cannot be raised past 1024 - please raise the limit or try again with fewer input files.").
- Dominant language
- C
- Stars
- 891
- Forks
- 277
- Avg merge
- 2d 23h
- Merged PRs (30d)
- 2
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from samtools/bcftools
-
needs-feedback
Difficulty 3/5 1-2 days Newbie friendliness 55/100
-
enhancement
Difficulty 5/5 Over a week Newbie friendliness 45/100
-
htslib-dependent P2: Desirable
Difficulty 3/5 1-2 days Newbie friendliness 48/100
-
Difficulty 5/5 Over a week Newbie friendliness 30/100
-
needs-feedback requires-test-case
Difficulty 3/5 1-2 days Newbie friendliness 55/100
All issues in samtools/bcftools
Similar issues
-
[adam] AdamNet network read doesn't cap to MAX_ADAM_PACKET_LEN, overflows client receive buffers Open
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
FujiNetWIFI/fujinet-firmware#1649 · 2 comments ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
HarbourMasters/Shipwright#7229 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
riscv-software-src/riscv-isa-sim#2435 · 1 comment ·
-
bug Self Built Image SNAPSHOT Supported Device target/ramips
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100