-
-
Notifications
You must be signed in to change notification settings - Fork 468
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
[17.0][FIX] Refactor stop signal handling in QueueJobRunner #647
Conversation
This commit refactors the stop signal handling in the `QueueJobRunner` class. Instead of using a pipe, it now uses a socket pair to initialize the stop signals. This change improves the code readability and ensures compatibility with Windows by manually creating a socket pair when the `socketpair` function is not available.
Hi @guewen, |
There hasn't been any activity on this pull request in the past 4 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days. |
This is too bad. @guewen is there a reason that this improvement wouldn't be considered? |
Hi @Maralai. Thanks for the contrib. This looks interesting but maybe too many changes at the same time. I'd recommend submitting as small incremental PR's that would be easier to review. |
This commit addresses the issue: #564.
Refactor QueueJobRunner to Enhance Performance, Signal Handling, and Stability
This pull request brings substantial improvements and new functionalities to the
QueueJobRunner
, which is focused on optimizing performance, signal handling, and stability. The significant changes include the transition to asynchronous HTTP requests, dynamic detection of new databases, and enhancements for robust signal handling.Key Changes:
Async HTTP Requests:
asyncio
andaiohttp
for handling HTTP job runs asynchronously. This change enhances concurrency and network-bound operation efficiency.Socket Pair for Signal Handling:
Selectors for Notification Handling:
selectors.DefaultSelector()
for handling database and stop signal notifications, improving efficiency and scalability of notification handling.Auto-Detection of New Databases:
queue_job
module installed, allowing dynamic adaptation without server restart.Configurable Check Interval:
Database Keep-Alive Mechanism:
SELECT 1
queries to keep database connections alive and prevent intermediaries from closing idle connections.Please review the changes and provide feedback or approval for merging this enhanced version of the
QueueJobRunner
. These improvements address the aforementioned issue and the todo's included within the original file, increasing robustness, scalability, and overall performance. I have included test cases and attempted to comply with pre-commit tests, with the aim of achieving a green checkmark.Thank you for your consideration.