Repository navigation
T-009: ENOTDIR race condition in copyFiles during node ace build on virtualized filesystems (Docker Desktop / DevContainers / WSL2) - #127
Merged
Conversation
Concurrent recursive mkdir calls for the same nested folder fail with ENOTDIR on virtualized filesystems, like Docker Desktop mounts. copyFiles now creates each unique destination folder one after the other, then copies the files in parallel. Fixes #125
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #125
Goal
copyFilesof@adonisjs/assembler(src/utils.ts) created the destination folder of each file insidePromise.all. Several files that share a nested folder ranmkdir(..., { recursive: true })on the same path at once. On the virtualized filesystems of Docker Desktop and devcontainers, that can fail withENOTDIR, andnode ace buildfails now and then.copyFilesnow creates each unique destination folder first, one after the other. Then it copies the files in parallel, as before.Deployment requirements
@adonisjs/assembleras a patch.Acceptance criteria
npm run lintandnpm run typecheckpass.npm run quick:test: 305 tests pass and 1 test fails. The failed test is not about this change. See "Checks".copyFilescreates each unique destination folder once, before it copies any file, then copies the files in parallel as today.src/utils.ts, and the debug output of the new test. The folders are in aSet, and they are created beforePromise.allcopies the files. Pass.copy several files that share a nested destination directoryintests/utils/copy.spec.ts. Pass.Checks
npm run lint: pass.npm run typecheck: pass.npm run quick:test: 305 pass, 1 fails. The failed test istests/dev_server.spec.ts, which expects the dev server on port 3334. On the build machine, another dev server held port 3334, sogetPort()gave a random port. The same test fails on the unchanged8.x. It does not touchcopyFiles.ENOTDIRfailure.Decisions about the code
build/resources/viewsandbuild/resources/views/emails. Parallelrecursivecalls on them can still createbuild/resourcesat the same time.Context changes
None.
Discovered work
tests/dev_server.spec.tsthat expectsServer address: cyan(http://localhost:3334)fails when another process listens on port 3334. It depends on a free port of the machine.