-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
Closed as not planned
Closed as not planned
Copy link
Labels
fsIssues and PRs related to the fs subsystem / file system.Issues and PRs related to the fs subsystem / file system.
Description
- Version:
12.2.0-12.18.4-14.13.0 - Platform:
Windows10,
Linux version 3.10.0-957.el7.x86_64 ([email protected]) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-36) (GCC) ) deps: update openssl to 1.0.1j #1 SMP Thu Nov 8 23:39:32 UTC 2018 - Subsystem:
What steps will reproduce the bug?
test-202.js
const { createReadStream } = require('fs')
// const highWaterMark = 127
// ./test-file-200
// 23
// ./test-file-200
// 23
// const highWaterMark = 128
// ./test-file-200
// 20
// ./test-file-200
// 20
// const highWaterMark = 129
// ./test-file-202
// 17
// ./test-file-202
// 128
// 18
// const highWaterMark = 160
// ./test-file-202
// 84
// ./test-file-202
// 84
// const highWaterMark = 199
// ./test-file-202
// 6
// ./test-file-202
// 184
// 21
const highWaterMark = 202
async function readFile(inputPath) {
console.log(inputPath)
const readStream = createReadStream(inputPath, {
encoding: 'binary',
highWaterMark
})
for await (const chunk of readStream) {
if (chunk.length !== highWaterMark) {
console.log(chunk.length)
}
}
}
async function test() {
for (const file of ['./test-file-202', './test-file-202']) {
await readFile(file)
}
}
test()
test-file-202
(10 * 20 + /r/n)
123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
How often does it reproduce? Is there a required condition?
Always with node v12.2.0-v12.18.4-14.13.0 and highWaterMark > 128
Works fine in node v10.22.1 v12.1.0 or highWaterMark <= 128
What is the expected behavior?
the same result
What do you see instead?
node test-202
./test-file-202
./test-file-202
200
2
Additional information
v12.2.0
fs: align fs.ReadStream buffer pool writes to 8-byte boundary
#24838
Metadata
Metadata
Assignees
Labels
fsIssues and PRs related to the fs subsystem / file system.Issues and PRs related to the fs subsystem / file system.