Skip to content

AAP-58539 Move to dispatcherd#16209

Merged
thedoubl3j merged 18 commits intoansible:develfrom
thedoubl3j:move_to_dispatcherd
Jan 23, 2026
Merged

AAP-58539 Move to dispatcherd#16209
thedoubl3j merged 18 commits intoansible:develfrom
thedoubl3j:move_to_dispatcherd

Conversation

@thedoubl3j
Copy link
Copy Markdown
Member

@thedoubl3j thedoubl3j commented Dec 17, 2025

SUMMARY

Removing the dispatcher feature flag as well as migrating anything that might be needed to new dispatcherd library.

PR is still a WIP and not finished. If you see anything or think of anything please note it.

ISSUE TYPE
  • Breaking Change
COMPONENT NAME
  • API
ADDITIONAL INFORMATION

Comment thread awx/main/dispatch/publish.py Outdated
@AlanCoding
Copy link
Copy Markdown
Member

Looking like it's making good progress. Next I would like to try to focus on the decorator transition

from awx.main.dispatch.publish import task as task_awx

Should be something that can be replaced now with the @task decorator directly from the dispatcherd library, and this will make obvious a lot of cascading deletions from there.

Comment thread awx/main/models/unified_jobs.py Outdated
@thedoubl3j thedoubl3j force-pushed the move_to_dispatcherd branch from 04536cf to 0bc3434 Compare January 6, 2026 17:29
@AlanCoding
Copy link
Copy Markdown
Member

from checks

  File "/awx_devel/awx/main/tasks/system.py", line 625, in <module>
    @task(queue=get_task_queuename, bind_kwargs=['dispatch_time', 'worker_tasks'])
     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: task() got an unexpected keyword argument 'bind_kwargs'
make[1]: *** [Makefile:344: test] Error 1

The bind_kwargs was from the old system and shouldn't be used anymore.

Comment thread awx/main/tasks/system.py Outdated
@thedoubl3j
Copy link
Copy Markdown
Member Author

#16209 (comment) I think this was coming from the old heartbeat function and is removed now.

Comment thread awx/main/dispatch/pool.py Outdated
Comment thread awx/main/dispatch/worker/callback.py
Comment thread awx/main/tasks/system.py Outdated
@thedoubl3j
Copy link
Copy Markdown
Member Author

thedoubl3j commented Jan 16, 2026

awx/main/dispatch/worker/__init__.py:3: in <module>
    from .task import TaskWorker  # noqa
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E   ImportError: cannot import name 'TaskWorker' from 'awx.main.dispatch.worker.task' (/awx_devel/awx/main/dispatch/worker/task.py)

this feels stale because that import no longer exists

Comment thread awx/main/dispatch/worker/base.py Outdated
Comment thread awx/main/dispatch/hazmat.py Outdated
@AlanCoding AlanCoding changed the title [WIP] Move to dispatcherd AAP-58539 [WIP] Move to dispatcherd Jan 19, 2026
@AlanCoding
Copy link
Copy Markdown
Member

If you have problems with the linters you might need to rebase to get #16232

also likely related to the code conflicts.

* started removing feature flags and adjusting logic
* WIP
* moved to dispatcher decorator
* updated as many as I could find
* remove any code that is not used by the call back receiver
* added back get_auto_max_workers into common utils
* formatting edits
* moved status out and deleted control as no longer needed
* removed hazmat
* removed unused imports
* adjusted test import to pull correct method
* fixed imports and addressed clusternode heartbeat test
* took a chainsaw to task.py as well
* added back hazmat per @AlanCoding feedback around config
* removed baseworker completely and refactored it into the callback
  worker
Comment thread awx/main/management/commands/run_dispatcher.py
@AlanCoding
Copy link
Copy Markdown
Member

Because the publish.py module was removed, it looks like DISPATCHER_MOCK_PUBLISH setting should be removed from all the other places. Just doing a find-all should discover all the locations that need lines deleted.

* added back some code that was lost in the merge conflict
* remove dispatcher mock publish setting
@thedoubl3j thedoubl3j marked this pull request as ready for review January 20, 2026 19:50
* fixed the call to cluster_node_heartbeat missing binder
* formatting/linter fixes
* add back more missing things
@AlanCoding
Copy link
Copy Markdown
Member

Next up, we see in server logs, via artifacts of the test run:

  File "/awx_devel/awx/main/dispatch/pool.py", line 73, in up
    logger.debug('scaling up worker pid:{}'.format(worker.pid))
                                                   ^^^^^^^^^^
AttributeError: 'PoolWorker' object has no attribute 'pid'

The pid method was removed, and I suggest just putting in worker.process.pid in favor of what's there. This prevents callback receiver from starting up which causes the failures.

* on a secret hunt to find the hidden attribute error in the server logs
@thedoubl3j thedoubl3j changed the title AAP-58539 [WIP] Move to dispatcherd AAP-58539 Move to dispatcherd Jan 22, 2026
@thedoubl3j thedoubl3j enabled auto-merge (squash) January 22, 2026 16:05
* updated the operator timeout to near healthy run time
Comment thread awx/settings/defaults.py Outdated
* Fully remove amd migrate away from celery scheduler
* Also put in ttry/except for receptor config on start up for debugging
@thedoubl3j thedoubl3j merged commit 36a00ec into ansible:devel Jan 23, 2026
16 checks passed
@sonarqubecloud
Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
43.8% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

AlanCoding added a commit to ansible/django-ansible-base that referenced this pull request Jan 26, 2026
Blocked by, and is follow-on stuff to ansible/awx#16209

Will have its hashes ruffled up by
#915

But that's just normal merge order of operations. Otherwise I think this
looks to be in good shape.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants