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

Resolve Infinite Retry Loop on Database Outage and Enhance Buffer Shutdown Behavior #296

Merged

Conversation

janbjorge
Copy link
Owner

@janbjorge janbjorge commented Jan 20, 2025

Addresses Issue #224, where the TimedOverflowBuffer would enter an infinite retry loop during database outages, blocking system shutdown and restart workflows. Key changes include:

  1. Retry Backoff on Flush:

    • Implemented retry_backoff and shutdown_backoff mechanisms to manage retries during normal operations and shutdown.
    • Prevented indefinite retries by capping delays and integrating shutdown-aware logic.
  2. Graceful Shutdown Enhancements:

    • Ensured pending flush operations exit cleanly during shutdown, even with unresolvable errors like database disconnections.
    • Integrated fine-grained control over shutdown behavior to balance recovery attempts with timely exits.
  3. Test Coverage:

    • Added test_job_buffer_callback_exception_during_teardown to validate handling of exceptions during buffer shutdown.
    • Simulated database outages and verified buffer behavior with live retries, recovery, and controlled exits.
  4. Documentation and Cleanup:

    • Updated docstrings for better clarity on buffer behavior and shutdown processes.
    • Improved parameter naming and code readability for backoff strategies.

Thanks to @AntonKarabaza for assisting with testing.

@janbjorge janbjorge force-pushed the misc/test_job_buffer_callback_exception_during_teardown branch 3 times, most recently from 12f195a to ae2ee33 Compare January 22, 2025 08:10
@janbjorge janbjorge self-assigned this Jan 22, 2025
@janbjorge janbjorge force-pushed the misc/test_job_buffer_callback_exception_during_teardown branch from ae2ee33 to 4f87fcc Compare January 22, 2025 18:14
@janbjorge janbjorge marked this pull request as ready for review January 22, 2025 18:15
@janbjorge janbjorge force-pushed the misc/test_job_buffer_callback_exception_during_teardown branch from 4f87fcc to 09b8a02 Compare January 22, 2025 18:21
@janbjorge janbjorge changed the title Add test_job_buffer_callback_exception_during_teardown Resolve Infinite Retry Loop on Database Outage and Enhance Buffer Shutdown Behavior Jan 22, 2025
@janbjorge janbjorge merged commit 2014e57 into main Jan 22, 2025
28 checks passed
@janbjorge janbjorge deleted the misc/test_job_buffer_callback_exception_during_teardown branch January 22, 2025 18:39
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.

1 participant