diff --git a/_lastrevision b/_lastrevision index 3bc96d5..263e7a1 100644 --- a/_lastrevision +++ b/_lastrevision @@ -1 +1 @@ -bf25c6e7dd034e44a3d16de37485c1914d6a93f5 \ No newline at end of file +a2ebac5641c371563ae0521639d3ff2f3aed22c1 \ No newline at end of file diff --git a/do-not-report-patches-as-installed-when-not-all-the-.patch b/do-not-report-patches-as-installed-when-not-all-the-.patch new file mode 100644 index 0000000..0854c3a --- /dev/null +++ b/do-not-report-patches-as-installed-when-not-all-the-.patch @@ -0,0 +1,45 @@ +From 769c9e85499bc9912b050fff7d3105690f1d7c7b Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Pablo=20Su=C3=A1rez=20Hern=C3=A1ndez?= + +Date: Wed, 13 Mar 2019 16:14:07 +0000 +Subject: [PATCH] Do not report patches as installed when not all the + related packages are installed (bsc#1128061) + +Co-authored-by: Mihai Dinca +--- + salt/modules/yumpkg.py | 18 ++++++++++++------ + 1 file changed, 12 insertions(+), 6 deletions(-) + +diff --git a/salt/modules/yumpkg.py b/salt/modules/yumpkg.py +index 4f26a41670..5ec3835574 100644 +--- a/salt/modules/yumpkg.py ++++ b/salt/modules/yumpkg.py +@@ -3212,12 +3212,18 @@ def _get_patches(installed_only=False): + for line in salt.utils.itertools.split(ret, os.linesep): + inst, advisory_id, sev, pkg = re.match(r'([i|\s]) ([^\s]+) +([^\s]+) +([^\s]+)', + line).groups() +- if inst != 'i' and installed_only: +- continue +- patches[advisory_id] = { +- 'installed': True if inst == 'i' else False, +- 'summary': pkg +- } ++ if not advisory_id in patches: ++ patches[advisory_id] = { ++ 'installed': True if inst == 'i' else False, ++ 'summary': [pkg] ++ } ++ else: ++ patches[advisory_id]['summary'].append(pkg) ++ if inst != 'i': ++ patches[advisory_id]['installed'] = False ++ ++ if installed_only: ++ patches = {k: v for k, v in patches.items() if v['installed']} + return patches + + +-- +2.20.1 + + diff --git a/salt.changes b/salt.changes index 1051813..d9ec62a 100644 --- a/salt.changes +++ b/salt.changes @@ -1,3 +1,15 @@ +------------------------------------------------------------------- +Tue Apr 30 11:51:59 UTC 2019 - psuarezhernandez@suse.com + +- Use ThreadPool from multiprocessing.pool to avoid leakings + when calculating FQDNs +- Do not report patches as installed on RHEL systems when not all + the related packages are installed (bsc#1128061) + +- Added: + * use-threadpool-from-multiprocessing.pool-to-avoid-le.patch + * do-not-report-patches-as-installed-when-not-all-the-.patch + ------------------------------------------------------------------- Fri Apr 26 10:00:01 UTC 2019 - mdinca@suse.de diff --git a/salt.spec b/salt.spec index 66d4443..8555f39 100644 --- a/salt.spec +++ b/salt.spec @@ -163,6 +163,10 @@ Patch47: calculate-fqdns-in-parallel-to-avoid-blockings-bsc-1.patch Patch48: fix-async-batch-race-conditions.patch #PATCH-FIX_OPENSUSE: https://github.com/openSUSE/salt/pull/141 Patch49: add-batch_presence_ping_timeout-and-batch_presence_p.patch +#PATCH-FIX_UPSTREAM: https://github.com/saltstack/salt/pull/52657 +Patch50: do-not-report-patches-as-installed-when-not-all-the-.patch +# PATCH-FIX_UPSTREAM https://github.com/saltstack/salt/pull/52527 +Patch51: use-threadpool-from-multiprocessing.pool-to-avoid-le.patch # BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRoot: %{_tmppath}/%{name}-%{version}-build @@ -670,6 +674,8 @@ cp %{S:5} ./.travis.yml %patch47 -p1 %patch48 -p1 %patch49 -p1 +%patch50 -p1 +%patch51 -p1 %build %if 0%{?build_py2} diff --git a/use-threadpool-from-multiprocessing.pool-to-avoid-le.patch b/use-threadpool-from-multiprocessing.pool-to-avoid-le.patch new file mode 100644 index 0000000..39783b4 --- /dev/null +++ b/use-threadpool-from-multiprocessing.pool-to-avoid-le.patch @@ -0,0 +1,47 @@ +From cd8e175738f7742fbb7c9e9d329039371bc0e579 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Pablo=20Su=C3=A1rez=20Hern=C3=A1ndez?= + +Date: Tue, 30 Apr 2019 10:51:42 +0100 +Subject: [PATCH] Use ThreadPool from multiprocessing.pool to avoid + leakings + +--- + salt/grains/core.py | 14 +++++++++----- + 1 file changed, 9 insertions(+), 5 deletions(-) + +diff --git a/salt/grains/core.py b/salt/grains/core.py +index 796458939d..fec7b204bc 100644 +--- a/salt/grains/core.py ++++ b/salt/grains/core.py +@@ -26,7 +26,7 @@ from errno import EACCES, EPERM + import datetime + import warnings + +-from multiprocessing.dummy import Pool as ThreadPool ++from multiprocessing.pool import ThreadPool + + # pylint: disable=import-error + try: +@@ -2225,10 +2225,14 @@ def fqdns(): + # Create a ThreadPool to process the underlying calls to 'socket.gethostbyaddr' in parallel. + # This avoid blocking the execution when the "fqdn" is not defined for certains IP addresses, which was causing + # that "socket.timeout" was reached multiple times secuencially, blocking execution for several seconds. +- pool = ThreadPool(8) +- results = pool.map(_lookup_fqdn, addresses) +- pool.close() +- pool.join() ++ ++ try: ++ pool = ThreadPool(8) ++ results = pool.map(_lookup_fqdn, addresses) ++ pool.close() ++ pool.join() ++ except Exception as exc: ++ log.error("Exception while creating a ThreadPool for resolving FQDNs: %s", exc) + + for item in results: + if item: +-- +2.17.1 + +