-
Notifications
You must be signed in to change notification settings - Fork 63
Add error handling for ObjectNotFoundErrror #561
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
Conversation
- add exception handling for clearing upload
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request adds error handling for ObjectDeletedError exceptions that can occur when an upload object is deleted by another process during project version creation. The changes add exception handling in two places: the controller's exception clause and within the Upload.clear() method itself.
Changes:
- Added
ObjectDeletedErrorto the list of exceptions caught during project version creation - Added try-except block in the Upload.clear() method to handle exceptions during cleanup
- Added redundant upload.clear() call in exception handler (problematic)
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| server/mergin/sync/public_api_v2_controller.py | Imports ObjectDeletedError, adds it to exception handling, and adds upload.clear() call in except block |
| server/mergin/sync/models.py | Wraps Upload.clear() method logic in try-except block to handle cleanup failures |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Pull Request Test Coverage Report for Build 21163477171Details
💛 - Coveralls |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Problem
In create project version controller wasn't handled ObjectDeletedError for upload row. Then, database versus data inconsistency occurred as no rollback was called there.
Future
Move locking of transaction to database using optimisitc locking (or similar), remove lockfile completely, ...