mirror of
https://github.com/ansible/awx.git
synced 2026-05-13 04:17:36 -02:30
Use shallow copy in fact cache plugin
This deep copy would cause ansible-playbook to get hung up and fail to spawn new subprocesses thus forcing extremely large scan jobs to serialize their connections through one process. This had the effect of forcing `forks=1` behavior. This change was for citco, a customer who is running scan jobs against 600 hosts with a forks value of 200.
This commit is contained in:
@@ -32,7 +32,7 @@
|
|||||||
import sys
|
import sys
|
||||||
import os
|
import os
|
||||||
import time
|
import time
|
||||||
from copy import deepcopy
|
from copy import copy
|
||||||
from ansible import constants as C
|
from ansible import constants as C
|
||||||
try:
|
try:
|
||||||
from ansible.cache.base import BaseCacheModule
|
from ansible.cache.base import BaseCacheModule
|
||||||
@@ -110,7 +110,7 @@ class CacheModule(BaseCacheModule):
|
|||||||
# Assume ansible fact triggered the set if no new module found
|
# Assume ansible fact triggered the set if no new module found
|
||||||
facts = self.filter_ansible_facts(value) if not module else dict({ module : value[module]})
|
facts = self.filter_ansible_facts(value) if not module else dict({ module : value[module]})
|
||||||
self._cache[key] = value
|
self._cache[key] = value
|
||||||
self._cache_prev = deepcopy(self._cache)
|
self._cache_prev = copy(self._cache)
|
||||||
packet = {
|
packet = {
|
||||||
'host': key,
|
'host': key,
|
||||||
'inventory_id': os.environ['INVENTORY_ID'],
|
'inventory_id': os.environ['INVENTORY_ID'],
|
||||||
|
|||||||
Reference in New Issue
Block a user