Unverified Commit c129e880 authored by Anna Henningsen's avatar Anna Henningsen Committed by Shelley Vohr
Browse files

fs: forbid concurrent operations on Dir handle

libuv does not expect concurrent operations on `uv_dir_t` instances,
and will gladly create memory leaks, corrupt data, or crash the
process.

This patch forbids that, and:

- Makes sure that concurrent async operations are run sequentially
- Throws an exception if sync operations are attempted during an
  async operation

The assumption here is that a thrown exception is preferable to
a potential hard crash.

This fully fixes flakiness from `parallel/test-fs-opendir` when
run under ASAN.

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


Reviewed-By: default avatarColin Ihrig <cjihrig@gmail.com>
parent aa4611cc
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