node fs compat pr #2 - #16422
Merged
Merged
node fs compat pr #2#16422
Conversation
Collaborator
|
Updated 12:00 PM PT - Jan 21st, 2025
❌ @dylan-conway, your commit dc16f00 has some failures in 🧪 try this PR locally: bunx bun-pr 16422 |
paperclover
force-pushed
the
chloe/node-fs-2
branch
from
January 15, 2025 23:51
6624060 to
9244d82
Compare
This was referenced Jan 22, 2025
This was referenced Feb 26, 2025
This was referenced Mar 27, 2025
robobun
pushed a commit
that referenced
this pull request
Sep 11, 2025
Issue #16037 reported that fs.createReadStream would emit 'end' event prematurely when piped to HTTP responses, especially with Fastify. The issue was already fixed in commit 5819fe4 (PR #16422) which rewrote fs.createReadStream to use proper async callbacks instead of Bun's native streaming that was causing premature 'end' events. This test ensures the issue stays fixed. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This was referenced Nov 2, 2025
This was referenced Jul 24, 2026
robobun
added a commit
that referenced
this pull request
Jul 26, 2026
Drop the writeSync-on-JS-thread approach: isFile() cannot tell an NFS / FUSE / sshfs-backed regular file from a local one, and write(2) on those blocks the event loop for the full network latency. libuv thread-pools all file I/O for this reason. Keep the coalescing win without the regression: stop shadowing the prototype _writev (the own-property undefined set in #16422 was what disabled batching), and have _writev drain the buffered batch as a single thread-pool fs.write on the concatenated buffer so the default path does not depend on fs.writev's IOV_MAX handling. A custom options.fs that supplies writev still gets writevAll. Also fix writevAll passing this.pos instead of its pos parameter on partial-write retries. [skip size check]
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.
fixes #8246
fixes #8255