augur
augur copied to clipboard
Improve Error Handling in Bulk Database Operations
The current implementation of bulk database operations in Augur uses a recursive approach for error handling that could lead to several issues:
- Stack Overflow: The recursive approach in
bulk_insert_dictscould cause stack overflow for large datasets - Inefficient Error Recovery: The current implementation splits data in half on any error, which is inefficient
- Lack of Error Categorization: Different types of errors are handled the same way
Proposed Solution:
- Implement an iterative approach for handling large datasets
- Add proper error categorization and specific handling strategies
- Implement a more efficient retry mechanism with exponential backoff
- Add better logging and monitoring for database operations
Technical Details:
- Current implementation in
application/db/lib.pyandapplication/db/session.py - Affects all bulk database operations across the application
- Impact on performance and reliability of data collection
Expected Outcome:
- More reliable database operations
- Better error recovery
- Improved performance for large datasets
- Better monitoring and debugging capabilities