mirror of
https://github.com/ansible/awx.git
synced 2026-02-27 15:58:45 -03:30
make the callback receiver more robust to duplicate UUIDs from ansible
This commit is contained in:
@@ -123,8 +123,16 @@ class PoolWorker(object):
|
|||||||
# if any tasks were finished, removed them from the managed tasks for
|
# if any tasks were finished, removed them from the managed tasks for
|
||||||
# this worker
|
# this worker
|
||||||
for uuid in finished:
|
for uuid in finished:
|
||||||
self.messages_finished += 1
|
try:
|
||||||
del self.managed_tasks[uuid]
|
del self.managed_tasks[uuid]
|
||||||
|
self.messages_finished += 1
|
||||||
|
except KeyError:
|
||||||
|
# ansible _sometimes_ appears to send events w/ duplicate UUIDs;
|
||||||
|
# UUIDs for ansible events are *not* actually globally unique
|
||||||
|
# when this occurs, it's _fine_ to ignore this KeyError because
|
||||||
|
# the purpose of self.managed_tasks is to just track internal
|
||||||
|
# state of which events are *currently* being processed.
|
||||||
|
pass
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def current_task(self):
|
def current_task(self):
|
||||||
|
|||||||
Reference in New Issue
Block a user