Closed pior closed 3 weeks ago
If the queue is removed via RemoveQueue, it will not be added back on the next enqueue because it will still exist in the map. We need to also remove it from the map on any
SREM("asynq::queues", qname)
Right. Removing from the queue is a nice, simple solution.
But is it enough to remove the queue from the map "locally" (in the same process). It works if a task is enqueued to the queue in the same process, but won't work for a different process.
Are we ok with this tradeoff?
(Implementation and tests updated)
It works if a task is enqueued to the queue in the same process, but won't work for a different process.
That's right. I think the tradeoff is fair.
Context
Before enqueueing every task, the name of the queue is published to a Redis Set key (
base.AllQueues
). This is only used by the inspector for inspection/monitoring purposes (not for the processing of tasks).Two consequences:
The issue #549 has more details about the impact on performance. We've confirmed the figures in production.
Fixes #549 Rework of #550
Changes
base.AllQueues
once per workerNotes:
base.AllQueues
will still be retried until it worked.