remove support for multi-reader dispatch queue

* Under the new postgres backed notify/listen message queue, this never
actually worked. Without using the database to store state, we can not
provide a at-most-once delivery mechanism w/ multi-readers.
* With this change, work is done ONLY on the node that requested for the
work to be done. Under rabbitmq, the node that was first to get the
message off the queue would do the work; presumably the least busy node.
This commit is contained in:
chris meyers
2020-01-16 14:26:16 -05:00
committed by Ryan Petrello
parent 50b56aa8cb
commit dc6c353ecd
6 changed files with 26 additions and 30 deletions

View File

@@ -8,7 +8,7 @@ from uuid import uuid4
from django.conf import settings
from django.db import connection
from . import pg_bus_conn
from . import pg_bus_conn, get_local_queuename
logger = logging.getLogger('awx.main.dispatch')
@@ -73,9 +73,12 @@ class task:
kwargs = kwargs or {}
queue = (
queue or
getattr(cls.queue, 'im_func', cls.queue) or
settings.CELERY_DEFAULT_QUEUE
getattr(cls.queue, 'im_func', cls.queue)
)
if not queue:
msg = f'{cls.name}: Queue value required and may not me None'
logger.error(msg)
raise ValueError(msg)
obj = {
'uuid': task_id,
'args': args,