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

Close file handle after getting its index (windows) #2728

Merged
merged 1 commit into from
Sep 25, 2024

Conversation

matheus-consoli
Copy link
Member

We're using the raw Windows API to read the file index ("inode"), but forgetting to close the handle after reading the metadata causing a leak of file handles.

This PR fixes the issue by manually closing the handle.

It will be better to use MetadataExt::file_index in the future once it gets stabilized.

Closes #2725

@matheus-consoli matheus-consoli requested a review from a team as a code owner September 25, 2024 15:16
Copy link

linear bot commented Sep 25, 2024

Copy link

vercel bot commented Sep 25, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
spacedrive-landing ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 25, 2024 3:17pm
spacedrive-web ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 25, 2024 3:17pm

@matheus-consoli
Copy link
Member Author

before this pr:
image

after it:
image

indexing the same location

@matheus-consoli matheus-consoli added this pull request to the merge queue Sep 25, 2024
Merged via the queue into main with commit 0699270 Sep 25, 2024
13 checks passed
@matheus-consoli matheus-consoli deleted the eng-1912-handle-leak-in-windows branch September 25, 2024 22:23
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.

Handle leak in Windows
2 participants