fs.ReadStream and fs.WriteStream emit an 'error' event when the read/write operation fails (because of ENOSPC/EIO/etc.) but they don't close the file descriptor. It requires the user to call stream.destroy() explicitly, otherwise the file descriptor is leaked.
I vaguely recall discussing this sometime ago but I forgot what exactly the motivation was (if any). If it's to restart the operation in case of transient errors, I don't think the current implementation is appropriate - it sets the readable and writable properties to false on error.
It should absolutely close the fd on error.
fs: fix ReadStream fd leak
Close the file descriptor when a read operation fails.
fs: fix WriteStream fd leak
Close the file descriptor when a write operation fails.