-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix potential race condition when copying files and directories #11857
Fix potential race condition when copying files and directories #11857
Conversation
This adds a missing await to the 'mkdirp' call which fixes a potential race condition in 'doCopy' whereby files are copied into a directory that hasn't been created yet. Signed-off-by: Erez Odier <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sensible change 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can confirm that the issue exists on master
and is addressed by this change 👍
I'm merging this even though the Node 16 CI is failing. I tried poking it again, but also see this has sporadic failures on master. |
…pse-theia#11857) This adds a missing await to the 'mkdirp' call which fixes a potential race condition in 'doCopy' whereby files are copied into a directory that hasn't been created yet. Signed-off-by: Erez Odier <[email protected]> Signed-off-by: Erez Odier <[email protected]>
…pse-theia#11857) This adds a missing await to the 'mkdirp' call which fixes a potential race condition in 'doCopy' whereby files are copied into a directory that hasn't been created yet. Signed-off-by: Erez Odier <[email protected]> Signed-off-by: Erez Odier <[email protected]>
…pse-theia#11857) This adds a missing await to the 'mkdirp' call which fixes a potential race condition in 'doCopy' whereby files are copied into a directory that hasn't been created yet. Signed-off-by: Erez Odier <[email protected]> Signed-off-by: Erez Odier <[email protected]>
…pse-theia#11857) This adds a missing await to the 'mkdirp' call which fixes a potential race condition in 'doCopy' whereby files are copied into a directory that hasn't been created yet. Signed-off-by: Erez Odier <[email protected]> Signed-off-by: Erez Odier <[email protected]>
…pse-theia#11857) This adds a missing await to the 'mkdirp' call which fixes a potential race condition in 'doCopy' whereby files are copied into a directory that hasn't been created yet. Signed-off-by: Erez Odier <[email protected]> Signed-off-by: Erez Odier <[email protected]>
…pse-theia#11857) This adds a missing await to the 'mkdirp' call which fixes a potential race condition in 'doCopy' whereby files are copied into a directory that hasn't been created yet. Signed-off-by: Erez Odier <[email protected]> Signed-off-by: Erez Odier <[email protected]>
…pse-theia#11857) This adds a missing await to the 'mkdirp' call which fixes a potential race condition in 'doCopy' whereby files are copied into a directory that hasn't been created yet. Signed-off-by: Erez Odier <[email protected]> Signed-off-by: Erez Odier <[email protected]>
What it does
This fixes a potential race condition when copying files with directories. The call to
mkdirp
was not awaited, meaning that subsequent copying of files within the copied directory would occasionally fail as the directory creation had not finished.How to test
We found this issue while duplicating a project in ARM mbed-ide, so presumably, copying a large git project will suffice.
Review checklist
Reminder for reviewers