[Fix] Replace backoff with tenacity and enhance database connection handling#167
Merged
[Fix] Replace backoff with tenacity and enhance database connection handling#167
Conversation
- Implemented detailed monitoring for PostgreSQL and SQLite database connections within the workspace doctor command. - Added checks for active connections, stale idle connections, and stale transaction connections for PostgreSQL. - Included a simple connectivity test for SQLite. - Enhanced error handling and reporting for database connection issues.
- Removed the redundant worker flag from the development mode in the server start script. - Adjusted the maximum overflow for PostgreSQL database connections from 10 to 5. - Changed the PostgreSQL connection pool recycle timeout from 300 to 240 seconds for improved resource management.
…d connection error handling - Updated database operation retry logic across multiple modules to use the new db_retry_policy decorator. - Simplified retry logic in user and dataset operations by removing redundant inner functions. - Enhanced logging of connection pool status during retry attempts for better debugging.
… handling - Removed the backoff library and replaced its usage with tenacity for retrying connection attempts in various modules. - Updated the retry decorators to enhance error handling for database and search engine connections. - Cleaned up the pdm.lock and pyproject.toml files by removing the backoff dependency.
…ngs" This reverts commit 904d595.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR improves database connection reliability and error handling by replacing the library with and implementing enhanced retry mechanisms for database operations.
Changes
Dependency Updates
Database Reliability Improvements
Database Health Checks
Code Simplification
Technical Details
Retry Policy Configuration
Database Health Check Features
Related Issues
Testing
Migration Notes