Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Address unpack race conditions using path reservations
This addresses a race condition where one archive entry depends on an earlier archive entry completing its unpack operation. For example, a File entry followed by a Link to that file would fail if the File was not written before the link() call was attempted, raising an ENOENT. Or, a File entry at a/b could be clobbered mid-write by an entry at a/b/c. This was never a problem for npm packages, because those tarballs are created as a point-in-time snapshot of the package file tree. Indeed, even in the generic case, it's a bit of an edge case. However, this race condition led to some flaky tests, and could certainly be a problem in general tar archive usage, especially if someone were to use tar.update() often to append entries to an archive. Address unpack race conditions using path reservations This addresses a race condition where one archive entry depends on an earlier archive entry completing its unpack operation. For example, a File entry followed by a Link to that file would fail if the File was not written before the link() call was attempted, raising an ENOENT. Or, a File entry at a/b could be clobbered mid-write by an entry at a/b/c. This was never a problem for npm packages, because those tarballs are created as a point-in-time snapshot of the package file tree. Indeed, even in the generic case, it's a bit of an edge case. However, this race condition led to some flaky tests, and could certainly be a problem in general tar archive usage, especially if someone were to use tar.update() often to append entries to an archive.
- Loading branch information