perf: Implement retry logic to improve resiliency #147
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.
Purpose
This pull request introduces optimizations and refactors to the SQL agent backend, focusing on improved performance, parallel processing, and enhanced retry logic. It removes outdated rate-limiting workarounds and streamlines agent communication strategies. The most significant changes include the overhaul of the
CommsManager
class, the introduction of batch processing, and the removal of unnecessaryasyncio
imports.Performance and Parallel Processing Improvements:
src/backend/sql_agents/helpers/comms_manager.py
: Refactored theCommsManager
class to include parallel processing capabilities, batch processing, optimized retry logic, and faster termination and selection strategies. Added a thread pool for parallel execution and reduced retry delays and truncation thresholds for improved efficiency.Removal of Deprecated Rate-Limiting Workarounds:
src/backend/sql_agents/convert_script.py
: Commented out the temporaryawait asyncio.sleep(5)
workaround in theconvert_script
function.src/backend/sql_agents/process_batch.py
: Commented out the temporaryawait asyncio.sleep(5)
workaround in theprocess_batch_async
function.Code Cleanup:
src/backend/sql_agents/convert_script.py
: Removed an unusedasyncio
import to clean up the code.src/backend/sql_agents/process_batch.py
: Removed an unusedasyncio
import to clean up the code.Does this introduce a breaking change?
Golden Path Validation
Deployment Validation
What to Check
Verify that the following are valid
Other Information