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

Add send_add_queue_command to dynamically add listening queue #1569

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

webfrank
Copy link

I wrote this PR to be able to add dynamically Queues to Workers sending a command to the relevant ones.

I also exposed Job from rq module directly (as Queue and Worker) and added RoundRobinWorker.

Add send_add_queue_command to dynamically add listening queue
@@ -492,6 +492,17 @@ def _shutdown(self):
def handle_warm_shutdown_request(self):
self.log.info('Warm shut down requested')

def add_queue(self, queue):
self.log.info(f'Asked to add queue: {queue}')
found = False
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens if the worker is currently blocking and waiting for a job to arrive in the current queue? In this case I think the worker should stop waiting and restart the process of waiting for jobs to arrive in self.queues.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are correct but I didn’t found a clean way for doing it. In my test environment I just lowered worker ttl but of course if workers are constantly busy the new queues will not be processed.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, so I think before we can get this in, we need to implement a way for the worker to stop waiting for jobs to arrive.

@knroy
Copy link

knroy commented Jul 3, 2022

Any progress on this?

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.

None yet

3 participants