Skip to content

fix: temporary files created by CLI are not deleted in some cases #5238

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

Merged
merged 2 commits into from
Feb 5, 2020

Conversation

rosen-vladimirov
Copy link
Contributor

@rosen-vladimirov rosen-vladimirov commented Feb 4, 2020

Currently CLI relies on temp module to create temporary files, which should be deleted once CLI process has no work left. However, in some cases, when Node.js crashes (or the process is killed with a signal) the temp module is unable to delete the files.
In order to fix this, introduce a tempService wrapper for temp module. For each path created by temp module, add a new cleanup action in the CLI's cleanup service, which will take care to delete the files even when the main CLI process dies with unusual error.

PR Checklist

What is the current behavior?

What is the new behavior?

Fixes issue #5239

Currently CLI relies on temp module to create temporary files, which should be deleted once CLI process has no work left. However, in some cases, when Node.js crashes (or the process is killed with a signal) the temp module is unable to delete the files.
In order to fix this, introduce a tempService wrapper for temp module. For each path created by temp module, add a new cleanup action in the CLI's cleanup service, which will take care to delete the files even when the main CLI process dies with unusual error.
@cla-bot cla-bot bot added the cla: yes label Feb 4, 2020
@rosen-vladimirov
Copy link
Contributor Author

test cli-run cli-plugin cli-misc cli-debug

@rosen-vladimirov
Copy link
Contributor Author

test cli-run cli-plugin cli-misc cli-debug cli-device

Copy link
Contributor

@DimitarTachev DimitarTachev left a comment

Choose a reason for hiding this comment

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

🥇

@rosen-vladimirov
Copy link
Contributor Author

Fails are not caused by this PR, so merging the changes

@rosen-vladimirov rosen-vladimirov merged commit c58e811 into release Feb 5, 2020
@rosen-vladimirov rosen-vladimirov deleted the vladimirov/temp-service branch February 5, 2020 06:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants