Skip to content

node fs compat pr #2 - #16422

Merged
Jarred-Sumner merged 136 commits into
mainfrom
chloe/node-fs-2
Jan 21, 2025
Merged

Jarred-Sumner merged 136 commits into
mainfrom
chloe/node-fs-2

Conversation

@paperclover

@paperclover paperclover commented Jan 15, 2025 •

Copy link
Copy Markdown
Contributor

fixes #8246
fixes #8255

@robobun

robobun commented Jan 15, 2025 •

Copy link
Copy Markdown
Collaborator
Updated 12:00 PM PT - Jan 21st, 2025

❌ @dylan-conway, your commit dc16f00 has some failures in #10297


🧪   try this PR locally:

bunx bun-pr 16422

@Jarred-Sumner
Jarred-Sumner merged commit 5819fe4 into main Jan 21, 2025
@Jarred-Sumner
Jarred-Sumner deleted the chloe/node-fs-2 branch January 21, 2025 18:28
@Jarred-Sumner
Jarred-Sumner restored the chloe/node-fs-2 branch January 27, 2025 02:51
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>
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]
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.

[win][fs] Crash on reading (fs.readFile) 2 GB file+ (reached unreachable code) [win][fs] There is no support of long paths

5 participants