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

Delete: During the deletion of a folder, additional files may be added. #279

Open
wants to merge 24 commits into
base: master
Choose a base branch
from

Conversation

janbarasek
Copy link
Contributor

  • bug fix
  • BC break? yes

New files may be created by another process while the directory is being deleted. The deletion will then fail. The new implementation repeatedly checks the files in the directory.

Demo:

Snímek obrazovky 2022-01-31 v 13 22 31

Snímek obrazovky 2022-01-31 v 13 32 52

Thanks.

@JanTvrdik
Copy link
Contributor

The error seems expected. You simply cannot delete a directory that is actively being written into.

@janbarasek
Copy link
Contributor Author

This means that, for example, the cache can never be removed if there are many parallel requests to the application.

How to safely delete the cache contents if there is an error?

For example, the rm -fr temp/cache/* command will always delete the contents safely and not cause an error to be thrown, like Nette.

@JanTvrdik
Copy link
Contributor

JanTvrdik commented Jan 31, 2022

This means that, for example, the cache can never be removed if there are many parallel requests to the application.

You can remove individual files, just not the directory itself.

@milo
Copy link
Member

milo commented Jan 31, 2022

For example, the rm -fr temp/cache/* command will always delete the contents safely and not cause an error to be thrown, like Nette.

That's because of -f option. It only mutes errors. Try -r only on rush directory. You get Directory not empty.

@janbarasek
Copy link
Contributor Author

So could Nette implement a force switch? There are certainly valid cases where this is useful.

@dg dg force-pushed the master branch 14 times, most recently from 6733224 to 5de10a1 Compare June 18, 2024 21:22
@dg dg force-pushed the master branch 16 times, most recently from a846fab to 736c567 Compare August 7, 2024 16:18
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

Successfully merging this pull request may close these issues.

4 participants