-
-
Notifications
You must be signed in to change notification settings - Fork 930
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
Is there a reason for \x06\x16 to be used as priority separator? #422
Comments
I often want to change this, but would prefer to find a way that does not break backwards incompatibility. There was no convention at the point when this was written, I guess a transport option would be possible |
We could for example check if the separator differs from \x06\x16 and issue a number of rename's in a redis transaction (to avoid concurrency problems)? I'd like to try and figure smth out with that. btw: we have found a workaround |
I just ran into this too, and on a whim googled for This is causing problems for me because I have a throttle = CeleryThrottle(q='some_queue')
for item in really_long_list:
throttle.maybe_wait()
process_item.delay(item) The idea is that it prevents a runaway Celery queue when processing millions of items. It does this by preventing the loop from proceeding until the queue is sufficiently short (100 items by default). Without the throttle, millions of tasks get added to redis all at once, and things go ka-boom. The way the throttle works is to periodically query redis to see how long the queue is, but with this weirdness going on, I'm not sure I understand what key to query in redis. Until this is fixed, is there a clear answer to that question? Will the key in redis always be named after the queue or after the queue + Thanks. |
@mlissner perhaps getting the current worker state can help you achieving this. |
@georgepsarakis No, that only lets you see what the workers have, not what is in the queue. There's no official way to see what's in the queue that I've been able to find. |
The flower project seems to have a solid implementation of what you want probably, see here. |
@georgepsarakis That's marvelous, thank you very much for this pointer. |
@mlissner you are welcome, hope it helps! |
This raises an issue with the documentation, which says that you can use the following to get the number of tasks in a queue:
We should tweak these docs to mention that that query will only return P0 tasks. |
If anyone would like to change this behavior. You can monkey patch it like this (on your own risk 😇 ):
Put it before you instantiate your celery app. |
The naming of priority queues in Redis doesn't currently work as it's described in the docs - the queues have a separator as well as a priority number appended to them, and the highest priority queue has no suffix. This change updates the docs to reflect this, and adds information on how to configure the separator. Relevant link: celery/kombu#422
The naming of priority queues in Redis doesn't currently work as it's described in the docs - the queues have a separator as well as a priority number appended to them, and the highest priority queue has no suffix. This change updates the docs to reflect this, and adds information on how to configure the separator. Relevant link: celery/kombu#422
The naming of priority queues in Redis doesn't currently work as it's described in the docs - the queues have a separator as well as a priority number appended to them, and the highest priority queue has no suffix. This change updates the docs to reflect this, and adds information on how to configure the separator. Relevant link: celery/kombu#422
The naming of priority queues in Redis doesn't currently work as it's described in the docs - the queues have a separator as well as a priority number appended to them, and the highest priority queue has no suffix. This change updates the docs to reflect this, and adds information on how to configure the separator. Relevant link: celery/kombu#422
It makes it really difficult to query redis from command line.
I tried
redis-cli type "queue_name\x06\x163"
and many other variants with some sort of escaping, but couldn't make it work.Also as far as I understand the naming convention in redis is to use ':' as a separator. redis.io
Could we maybe make it configurable via an environment variable or otherwise?
The text was updated successfully, but these errors were encountered: