Skip to content

Commit

Permalink
Add back in cleanup call
Browse files Browse the repository at this point in the history
  • Loading branch information
AlanCoding committed Aug 17, 2022
1 parent ccd46a1 commit 6719010
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions awx/main/dispatch/pool.py
Original file line number Diff line number Diff line change
Expand Up @@ -378,8 +378,6 @@ def cleanup(self):
1. Discover worker processes that exited, and recover messages they
were handling.
2. Clean up unnecessary, idle workers.
3. Check to see if the database says this node is running any tasks
that aren't actually running. If so, reap them.
IMPORTANT: this function is one of the few places in the dispatcher
(aside from setting lookups) where we talk to the database. As such,
Expand Down Expand Up @@ -465,6 +463,9 @@ def write(self, preferred_queue, body):
try:
if isinstance(body, dict) and body.get('bind_kwargs'):
self.add_bind_kwargs(body)
# when the cluster heartbeat occurs, clean up internally
if isinstance(body, dict) and 'cluster_node_heartbeat' in body['task']:
self.cleanup()
if self.should_grow:
self.up()
# we don't care about "preferred queue" round robin distribution, just
Expand Down

0 comments on commit 6719010

Please sign in to comment.