Repository navigation
Conversation
Rows for writer.end(), writer.close() and Bun.write(path, stream). Each row opens the file with a share mode of 0 where the API reports done, and counts the rounds in which another handle is still open. Windows only.
Each measurement fails on purpose so that its numbers reach the CI output. This file is removed before the pull request leaves draft.
Collaborator
Author
|
Updated 1:10 PM PT - Oct 21st, 2026
❌ @robobun, your commit 83a69de has 2 failures in
🧪 To try this PR locally: bunx bun-pr 46344That installs a local version of the PR into your bun-46344 --bun |
Collaborator
Author
|
Status
|
This was referenced Oct 21, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
await Bun.file(path).writer().end()andawait Bun.write(path, new Response(stream))settle with the file handle still open. This is read from the source. Nobody ran it on Windows before this pull request.BaseWindowsPipeWriter::close_impl(src/io/PipeWriter.rs:1257) queuesuv_fs_closeon libuv's thread pool and callson_closein the same frame.FileSink::on_write(src/runtime/webcore/FileSink.rs:428) settles the promise ofend()before it queues the close.Status: draft, tests first
mainbefore the fix is pushed.test/js/bun/util/filesink.test.tshas new Windows-only rows. Each row opens the file with a share mode of 0 where the API reports done.test/js/bun/util/filesink-close-time-probe.test.tsis temporary. It fails on purpose to print close times from the Windows lanes. It is removed before this pull request leaves draft.Background
FileSinkis the native writer behindBun.file(path).writer()andBun.write(path, stream). On Windows it writes withuv_fs_writeand closes withuv_fs_close, both on libuv's thread pool.