Skip to content
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

🤖 Implement Chunked Processing and Retry Logic for Cleanup Tasks #1618

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

sentry-autofix[bot]
Copy link
Contributor

👋 Hi there! This PR was automatically generated by Autofix 🤖

This fix was triggered by Rohan Agarwal

Fixes SEER-DF

This change adds a new utility module with functions for chunked data processing and retry logic for database operations, specifically handling OperationalError with exponential backoff. The main changes are:

  1. New utility functions chunks, with_retry, and safe_commit added in src/seer/anomaly_detection/utils.py to facilitate chunk processing and error handling.

  2. The cleanup_timeseries function in src/seer/anomaly_detection/tasks.py is updated to delete old timeseries points and update matrix profiles in chunks, enhancing efficiency and robustness against connection issues.

  3. A test case in tests/seer/anomaly_detection/test_cleanup_tasks.py is added to verify that the chunked processing correctly handles database connection issues when processing large batches, ensuring that the retry logic works as intended and that the data integrity is maintained.

Overall, this enhances the anomaly detection tasks by improving failure resilience and making the processing more efficient.

If you have any questions or feedback for the Sentry team about this fix, please email [email protected] with the Run ID: 1361.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants