Unverified Commit 8a5c7f6a authored by Anna Henningsen's avatar Anna Henningsen
Browse files

fs: synchronize close with other I/O for streams

Part of the flakiness in the
parallel/test-readline-async-iterators-destroy test comes from
fs streams starting `_read()` and `_destroy()` without waiting
for the other to finish, which can lead to the `fs.read()` call
resulting in `EBADF` if timing is bad.

Fix this by synchronizing write and read operations with `close()`.

Refs: https://github.com/nodejs/node/issues/30660

PR-URL: https://github.com/nodejs/node/pull/30837


Reviewed-By: default avatarLuigi Pinca <luigipinca@gmail.com>
Reviewed-By: default avatarBen Noordhuis <info@bnoordhuis.nl>
Reviewed-By: default avatarMatteo Collina <matteo.collina@gmail.com>
Reviewed-By: default avatarRich Trott <rtrott@gmail.com>
parent 4a5fb74f
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment