Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

faidx file not closed when Reader goes out of scope: Too many open files #390

Closed
wdecoster opened this issue May 12, 2023 · 3 comments · Fixed by #391
Closed

faidx file not closed when Reader goes out of scope: Too many open files #390

wdecoster opened this issue May 12, 2023 · 3 comments · Fixed by #391

Comments

@wdecoster
Copy link

wdecoster commented May 12, 2023

Hi,

I have a tool that repeatedly calls fetch_seq on a faidx::Reader::from_path, and eventually runs into:

[E::fai_load3_core] Failed to open FASTA index GCA_000001405.15_GRCh38_no_alt_analysis_set.fa.fai: Too many open files
Segmentation fault (core dumped)

I don't see a method to close the file, although the Reader instance goes out of scope (when the function ends). So the file seems not closed when the Reader is dropped. Does anyone have an idea to fix this? I'm not sure if it is something I should do, or a change required in rust-htslib, or a problem on the C side.

I saw a very similar problem reported here #365

Thanks!
Wouter

@wdecoster wdecoster changed the title faidx close file faidx file not closed when Reader goes out of scope: Too many open files May 12, 2023
@johanneskoester
Copy link
Contributor

Please reopen if the merged PR does not fix the issue.

@johanneskoester
Copy link
Contributor

And thanks for reporting!

@wdecoster
Copy link
Author

wdecoster commented May 16, 2023

I can confirm that solves the problem :-) Thanks for the quick fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants