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

Rescue if file is already deleted #2552

Closed
2 tasks done
maxkadel opened this issue Nov 13, 2024 · 0 comments · Fixed by #2562
Closed
2 tasks done

Rescue if file is already deleted #2552

maxkadel opened this issue Nov 13, 2024 · 0 comments · Fixed by #2562
Assignees
Labels
bug 🐛 The application does not work as expected because of a defect

Comments

@maxkadel
Copy link
Contributor

maxkadel commented Nov 13, 2024

Expected behavior

If we're trying to delete a file and it's already deleted the application doesn't raise an error and doesn't re-try

Actual behavior

If the code can't delete a file that's already been removed, it raises an error (I'm not sure how this happens, but as long as the file is deleted I don't think it matters - I'm guessing that somehow there's a race condition, or multiple servers are running this against the same filesystem at the same time)

Impact of this bug

Noise in the logs, have to re-try the job.

Acceptance criteria

  • If this change touches any of the files referenced in .rubocop_todo.yml create a new ticket to address the rubocop todo.
  • If a file is deleted while the delete_stale_files method is being called, it does not stop the code. It does log the error.

Honeybadger link and code snippet, if applicable

https://app.honeybadger.io/projects/54497/faults/114481686

line 22 of [PROJECT_ROOT]/app/jobs/scsb_import_full_job.rb: delete_stale_files
line 3 of [PROJECT_ROOT]/app/jobs/scsb_import_full_job.rb: perform

Implementation notes, if any

Rescue from a Errno::ENOENT error, log it, and continue

@maxkadel maxkadel added the bug 🐛 The application does not work as expected because of a defect label Nov 13, 2024
@sandbergja sandbergja self-assigned this Dec 16, 2024
christinach added a commit that referenced this issue Dec 16, 2024
[#2552] Don't stop the SCSB import full job if stale file is already deleted
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 The application does not work as expected because of a defect
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants