augur icon indicating copy to clipboard operation
augur copied to clipboard

Improve Error Handling in Bulk Database Operations

Open KhanRayyan3622 opened this issue 8 months ago • 0 comments

The current implementation of bulk database operations in Augur uses a recursive approach for error handling that could lead to several issues:

  1. Stack Overflow: The recursive approach in bulk_insert_dicts could cause stack overflow for large datasets
  2. Inefficient Error Recovery: The current implementation splits data in half on any error, which is inefficient
  3. Lack of Error Categorization: Different types of errors are handled the same way

Proposed Solution:

  1. Implement an iterative approach for handling large datasets
  2. Add proper error categorization and specific handling strategies
  3. Implement a more efficient retry mechanism with exponential backoff
  4. Add better logging and monitoring for database operations

Technical Details:

  • Current implementation in application/db/lib.py and application/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

KhanRayyan3622 avatar Apr 07 '25 16:04 KhanRayyan3622