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

kpy save timing could be optimized #36

Open
pvandyken opened this issue Jun 10, 2022 · 0 comments
Open

kpy save timing could be optimized #36

pvandyken opened this issue Jun 10, 2022 · 0 comments

Comments

@pvandyken
Copy link
Owner

kpy save first writes the venv to a tmp file, then moves it to the final destination. This helps prevent data loss when overwriting an old venv: should the process get interrupted, the overwritten file won't get deleted until the last possible moment.

This last possible moment could be delayed even further: currently, the tmp tar file is being written on whatever tmp filesystem is available. This could be a different filesystem the the storage dir, which would require a cp operation upon moving. This cp could take a minute or two if the tar is very large. A better approach would be to first mv the tar file into the dest directory under a tmp name, then delete the overwritten file, then rename the tmp file to final

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant