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:Luigi Pinca <luigipinca@gmail.com> Reviewed-By:
Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By:
Matteo Collina <matteo.collina@gmail.com> Reviewed-By:
Rich Trott <rtrott@gmail.com>
parent
4a5fb74f
Please register or sign in to comment