You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Fallback for older node versions doesn't accept backpressure from readable stream #349
I don't actually know if readable streams support backpressure in this way, but the incoming data stream is not paused and resumed to allow backpressure. According to google, Readable.toWeb applies backpressure properly, so this only applies to the fallback. This would result in older versions reading the entire file into memory quickly and then slowly trickling it out over TCP.
You’re right that the current fallback can use more memory when serving large files to slow clients. If we were to address it, the change would look something like this:
That said, Node.js 20.x is already EOL, and Node.js 22.x avoids this fallback path when using a recent minor version. So I’m still not sure whether it is worth adding this complexity.
I see! As you said, Node.js 20.x is EOL, and we may not need to be eager to support it, but actually, this adapter says "It works on Node.js versions greater than 20.x." on the README. So it's better to apply the PR #351. It already seems good and not too large.
Activity
usualoma commentedon May 7, 2026
Hi @Arlen22,
Thanks for pointing this out.
You’re right that the current fallback can use more memory when serving large files to slow clients. If we were to address it, the change would look something like this:
#351
That said, Node.js 20.x is already EOL, and Node.js 22.x avoids this fallback path when using a recent minor version. So I’m still not sure whether it is worth adding this complexity.
usualoma commentedon May 7, 2026
Hi @yusukebe,
What do you think?
yusukebe commentedon May 7, 2026
Hi @usualoma
I see! As you said, Node.js 20.x is EOL, and we may not need to be eager to support it, but actually, this adapter says "
It works on Node.js versions greater than 20.x." on the README. So it's better to apply the PR #351. It already seems good and not too large.fix: handle serveStatic stream fallback backpressure (honojs#351)