Skip to content

Potential helper to fix EBADF errors#10

Merged
cmdcolin merged 3 commits intomainfrom
localfile_close
Sep 6, 2025
Merged

Potential helper to fix EBADF errors#10
cmdcolin merged 3 commits intomainfrom
localfile_close

Conversation

@cmdcolin
Copy link
Copy Markdown
Contributor

@cmdcolin cmdcolin commented Sep 4, 2025

I asked google gemini to analyze the localFile class to see if it can help with any issues that might cause the EBADF errors

This code change allows the code to close the resource more reliably

Per gemini:

"If an error occurs after await open(...) but before await fd.close(), the fd.close() call is skipped entirely, leading to a file descriptor leak. The finally block ensures that cleanup code runs even if an error is thrown."

This seems like a good catch, but there is the potential that this doesn't truly fix anything related to EBADF

@cmdcolin
Copy link
Copy Markdown
Contributor Author

cmdcolin commented Sep 4, 2025

xref GMOD/jbrowse-components#5150

@cmdcolin cmdcolin merged commit 32a9e2f into main Sep 6, 2025
1 check passed
@cmdcolin cmdcolin deleted the localfile_close branch September 6, 2025 13:16
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 this pull request may close these issues.

1 participant