Skip to content

Conversation

hdonnay
Copy link
Member

@hdonnay hdonnay commented Sep 10, 2025

This is should fix a file descriptor (and file) leak when there's an error return while writing the file. This leak would result in the file descriptor hanging around until a GC cycle and the backing file not being deleted when not using O_TMPFILE.

Depends on: #1547

@hdonnay hdonnay requested a review from jvdm September 10, 2025 18:50
@hdonnay hdonnay force-pushed the bug/fetcher-leak branch 2 times, most recently from e8545e9 to 0950161 Compare September 10, 2025 19:44
@BradLugo

This comment was marked as outdated.

@hdonnay

This comment was marked as outdated.

Since this code was added, the `math/rand/v2` package has landed and
does the same thing (use the runtime's fast random numbers), but in a
supported way.

Signed-off-by: Hank Donnay <hdonnay@redhat.com>
This also ends up restructuring things to work with normal `*os.File`
instead of the `tempFile` type.

Signed-off-by: Hank Donnay <hdonnay@redhat.com>
@hdonnay hdonnay marked this pull request as ready for review September 25, 2025 17:23
@hdonnay hdonnay requested a review from a team as a code owner September 25, 2025 17:23
@hdonnay hdonnay requested review from crozzy and removed request for a team September 25, 2025 17:23
@BradLugo BradLugo self-requested a review October 14, 2025 06:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants