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_callback should support to ignore silently the fact that fpath is missing #192

Open
benoit74 opened this issue Aug 9, 2024 · 1 comment
Labels
enhancement New feature or request
Milestone

Comments

@benoit74
Copy link
Collaborator

benoit74 commented Aug 9, 2024

We have a helper delete_callback at

This delete_callback is meant to be used as a callback when adding an item to the ZIM, typically to delete original file once it has been added to the ZIM.

There are some edge cases where the file to delete might already be gone, typically when the scraper encounters an Exception and decides to stop ZIM creation and delete all temporary files on exit. Due to the concurrency of these operations, the deletion of temporary files on exit might complete before the delete_callback is invoked.

I think that we should enhance the delete_callback to either:

  1. always silently ignore when the file to delete is already gone
  2. provide a parameter to activate the silent ignore of missing file

Solution 2 would help in the sense that some scrapers might have silent bugs if we silently ignore deletion issues, leading to huge disk space consumption for nothing. However the edge cases causing the issue mentioned where file is already gone are pretty rare and difficult to produce, so I'm more in favor of solution 1 since I would assume most scraper developers will never realize such situations might appear until hit by them (probably in production).

This issue has been originally unveiled by @dan-niles in Youtube scraper, kudos.

@benoit74 benoit74 added the enhancement New feature or request label Aug 9, 2024
@benoit74 benoit74 added this to the 4.1.0 milestone Aug 9, 2024
@rgaudin
Copy link
Member

rgaudin commented Aug 9, 2024

I'm in line with everything you wrote. A warning in the logs would be enough at first

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

No branches or pull requests

2 participants