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:
Matthew Jones 2016-05-02 13:34:47 -04:00
parent 55c230f428
commit 9cc9ef6b33

View File

@ -32,7 +32,7 @@
import sys
import os
import time
from copy import deepcopy
from copy import copy
from ansible import constants as C
try:
from ansible.cache.base import BaseCacheModule
@ -110,7 +110,7 @@ class CacheModule(BaseCacheModule):
# 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]})
self._cache[key] = value
self._cache_prev = deepcopy(self._cache)
self._cache_prev = copy(self._cache)
packet = {
'host': key,
'inventory_id': os.environ['INVENTORY_ID'],