Skip to content

Fix/600 improve process item deletion error handling#632

Open
neilcroft wants to merge 2 commits intosuitenumerique:mainfrom
neilcroft:fix/600-improve-process-item-deletion-error-handling
Open

Fix/600 improve process item deletion error handling#632
neilcroft wants to merge 2 commits intosuitenumerique:mainfrom
neilcroft:fix/600-improve-process-item-deletion-error-handling

Conversation

@neilcroft
Copy link
Copy Markdown
Contributor

Purpose

The task process_item_deletion crashes if the object storage is unreachable,
leaving orphan items in the database. Also, the clean_pending_items command
deletes items from DB without cleaning their files from storage.

Closes #600

Proposal

  • Catch ClientError and BotoCoreError around default_storage.delete() in
    process_item_deletion so the item is still removed from DB on storage failure
  • Use soft_delete()hard_delete()process_item_deletion.delay() in
    clean_pending_items to also remove orphan files from storage

If the object storage is unreachable or returns an error,
the item should still be deleted from the database.

Closes suitenumerique#600
Use process_item_deletion to delete stale pending items so
that eventual files on the storage are also removed.

Refs suitenumerique#600
@neilcroft neilcroft force-pushed the fix/600-improve-process-item-deletion-error-handling branch from becc1c1 to c74b116 Compare March 31, 2026 13:53
@sonarqubecloud
Copy link
Copy Markdown

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.

Improve error handling of process_item_deletion

1 participant