Skip to content
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

Merged
merged 1 commit into from
Nov 10, 2022

Conversation

erezmus
Copy link
Contributor

@erezmus erezmus commented Nov 10, 2022

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

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]>
@erezmus erezmus marked this pull request as ready for review November 10, 2022 09:25
@msujew msujew added the filesystem issues related to the filesystem label Nov 10, 2022
Copy link
Member

@thegecko thegecko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sensible change 👍

Copy link
Member

@msujew msujew left a 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 👍

@thegecko
Copy link
Member

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.

@thegecko thegecko merged commit b8791cc into eclipse-theia:master Nov 10, 2022
@erezmus erezmus deleted the fix-mkdirp-race-condition branch November 10, 2022 13:58
@vince-fugnitto vince-fugnitto added this to the 1.32.0 milestone Nov 24, 2022
federicobozzini pushed a commit to ARMmbed/theia that referenced this pull request Apr 17, 2023
…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]>
federicobozzini pushed a commit to ARMmbed/theia that referenced this pull request Apr 25, 2023
…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]>
erezmus added a commit to ARMmbed/theia that referenced this pull request May 11, 2023
…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]>
CareyJWilliams pushed a commit to ARMmbed/theia that referenced this pull request Jun 22, 2023
…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]>
CareyJWilliams pushed a commit to ARMmbed/theia that referenced this pull request Jun 23, 2023
…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]>
erezmus added a commit to ARMmbed/theia that referenced this pull request Aug 2, 2023
…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]>
erezmus added a commit to ARMmbed/theia that referenced this pull request Sep 12, 2023
…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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
filesystem issues related to the filesystem
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants