!167 sync patches and revet fix deadlock when forking in multithread

Merge pull request !167 from t.feng/master
This commit is contained in:
openeuler-ci-bot 2022-01-22 06:22:08 +00:00 committed by Gitee
commit 13f5826602
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
3 changed files with 79 additions and 166 deletions

View File

@ -4,7 +4,7 @@
%endif
Name: anaconda
Version: 33.19
Release: 31
Release: 35
Summary: Graphical system installer
License: GPLv2+ and MIT
URL: http://fedoraproject.org/wiki/Anaconda
@ -117,9 +117,9 @@ Patch6073: bugfix-Fix-issue-when-ns_info-cannot-be-retrieved-for-NVDim.patch
Patch6074: bugfix-Fix-SECTION-headers-in-docstrings.patch
Patch6075: change-inst-repo-default-value.patch
Patch6076: delete-datezone-map.patch
Patch6077: backport-fix-boot-options-generated-by-dracut-module.patch
Patch9026: fix-deadlock-when-forking-in-multithread.patch
Patch6077: backport-fix-boot-options-generated-by-dracut-module.patch
Patch9027: bugfix-remove-flatpack-support.patch
%define dbusver 1.2.3
%define dnfver 3.6.0
@ -127,7 +127,6 @@ Patch9026: fix-deadlock-when-forking-in-multithread.patch
%define fcoeutilsver 1.0.12-3.20100323git
%define gettextver 0.19.8
%define gtk3ver 3.22.17
%define helpver 22.1-1
%define isomd5sum 1.0.10
%define langtablever 0.0.49
%define libarchivever 3.0.4
@ -146,7 +145,7 @@ BuildRequires: python3-pygments
BuildRequires: audit-libs-devel libtool gettext-devel >= %{gettextver} gtk3-devel >= %{gtk3ver}
BuildRequires: gtk-doc gtk3-devel-docs >= %{gtk3ver} glib2-doc gobject-introspection-devel
BuildRequires: glade-devel libgnomekbd-devel libxklavier-devel >= %{libxklavierver} pango-devel
BuildRequires: python3-kickstart >= %{pykickstartver} python3-devel python3-nose systemd
BuildRequires: python3-kickstart >= %{pykickstartver} python3-devel systemd
BuildRequires: rpm-devel >= %{rpmver} libarchive-devel >= %{libarchivever} gdk-pixbuf2-devel
BuildRequires: libxml2
BuildRequires: gsettings-desktop-schemas metacity
@ -158,7 +157,7 @@ Requires: kexec-tools createrepo_c tmux gdb rsync python3-meh-gui >= %{mehver}
Requires: adwaita-icon-theme python3-kickstart
Requires: tigervnc-server-minimal libxklavier >= %{libxklavierver} libgnomekbd
Requires: xz
Requires: nm-connection-editor keybinder3 anaconda-user-help >= %{helpver} yelp system-logos
Requires: nm-connection-editor keybinder3 yelp system-logos
Requires: python3 dracut >= %{dracutver} dracut-network dracut-live
%ifarch %{ix86} x86_64
BuildRequires: desktop-file-utils
@ -269,6 +268,10 @@ update-desktop-database &> /dev/null || :
update-desktop-database &> /dev/null || :
%endif
#Anaconda test cases require python3-nose. However, python3-nose on 22.03 has been deleted due to aging.
#As a result, the anaconda lacks dependency. Now, the anaconda needs to remove the python3-nose dependency.
#However, the removal will affect the test cases.
%files
%defattr(-,root,root)
%license COPYING
@ -334,24 +337,48 @@ update-desktop-database &> /dev/null || :
%{_datadir}/gtk-doc
%changelog
* Wed Dec 29 2021 xihaochen <xihaochen@huawei.com> - 33.19-31
* Sat Jan 22 2022 fengtao <fengtao40@huawei.com> - 33.19-35
- Type:bugfix
- CVE:NA
- SUG:NA
- DESC:revert "fix deadlock when forking in multithread"
* Thu Jan 13 2022 gaihuiying <gaihuiying1@huawei.com> - 33.19-34
- Type:bugfix
- CVE:NA
- SUG:NA
- DESC:remove flatpak support in source code
* Tue Jan 11 2022 gaihuiying <gaihuiying1@huawei.com> - 33.19-33
- Type:bugfix
- CVE:NA
- SUG:NA
- DESC:remove anaconda-user-help dependency
* Fri Dec 31 2021 xihaochen <xihaochen@huawei.com> - 33.19-32
- Type:bugfix
- CVE:NA
- SUG:NA
- DESC:remove flatpak dependency
* Fri Oct 29 2021 orange-snn <songnannan2@huawei.com> - 33.19-30
* Fri Dec 31 2021 xihaochen <xihaochen@huawei.com> - 33.19-31
- Type:bugfix
- CVE:NA
- SUG:NA
- DESC:remove python3-nose dependency
* Fri Oct 29 2021 zhujunhao <zhujunhao8@huawei.com> - 33.19-30
- Type:bugfix
- CVE:NA
- SUG:NA
- DESC:fix boot options generated by dracut module
* Sat Aug 28 2021 yanan <yanan@huawei.com> - 33.19-29
- Type:bugfix
- CVE:NA
- SUG:NA
- DESC:fix deadlock when forking in multithread
* Fri Oct 29 2021 fengtao <fengtao40@huawei.com> - 33.19-29
- Type:bugfix
- ID:NA
- SUG:NA
- DESC:fix boot options generated by dracut module
* Mon Aug 23 2021 wangce <wangce@uniontech.com> - 33.19-28
- Type:bugfix
- ID:NA

View File

@ -0,0 +1,38 @@
From 1c7eed3607410d62324e368cc4fe9fb3f541cc48 Mon Sep 17 00:00:00 2001
From: eaglegai <eaglegai@163.com>
Date: Thu, 13 Jan 2022 18:49:29 +0800
Subject: [PATCH] remove flatpack support
---
pyanaconda/anaconda.py | 9 ++-------
1 file changed, 2 insertions(+), 7 deletions(-)
diff --git a/pyanaconda/anaconda.py b/pyanaconda/anaconda.py
index 8c54011..c1108f2 100644
--- a/pyanaconda/anaconda.py
+++ b/pyanaconda/anaconda.py
@@ -28,7 +28,6 @@ from pyanaconda.core.constants import DisplayModes
from pyanaconda.core import constants
from pyanaconda.core.startup.dbus_launcher import AnacondaDBusLauncher
from pyanaconda.payload.source import SourceFactory, PayloadSourceTypeUnrecognized
-from pyanaconda.payload.flatpak import FlatpakPayload
from pyanaconda.anaconda_loggers import get_stdout_logger
stdoutLog = get_stdout_logger()
@@ -79,12 +78,8 @@ class Anaconda(object):
# class. If it doesn't give us one, fall back to the default.
if not self._payload:
if self.ksdata.ostreesetup.seen:
- if FlatpakPayload.is_available():
- from pyanaconda.payload.rpmostreepayload import RPMOSTreePayloadWithFlatpaks
- klass = RPMOSTreePayloadWithFlatpaks
- else:
- from pyanaconda.payload.rpmostreepayload import RPMOSTreePayload
- klass = RPMOSTreePayload
+ from pyanaconda.payload.rpmostreepayload import RPMOSTreePayload
+ klass = RPMOSTreePayload
elif self.opts.liveinst:
from pyanaconda.payload.live import LiveOSPayload
klass = LiveOSPayload
--
2.30.0

View File

@ -1,152 +0,0 @@
From ed78249ad5f3bf44777d0bdd39bb3f1a2890239d Mon Sep 17 00:00:00 2001
From: "t.feng" <fengtao40@huawei.com>
Date: Mon, 2 Aug 2021 15:07:01 +0600
Subject: [PATCH] fix deadlock when forking in multithread
---
pyanaconda/core/glib.py | 19 +++++++++++++++++--
pyanaconda/payload/dnf/payload.py | 15 +++++++++++----
pyanaconda/payload/dnf/utils.py | 2 ++
.../ui/gui/spokes/installation_progress.py | 4 ++++
4 files changed, 34 insertions(+), 6 deletions(-)
diff --git a/pyanaconda/core/glib.py b/pyanaconda/core/glib.py
index 03c598d..e1cb8db 100644
--- a/pyanaconda/core/glib.py
+++ b/pyanaconda/core/glib.py
@@ -33,9 +33,10 @@ from gi.repository.GLib import markup_escape_text, format_size_full, \
MainLoop, MainContext, \
GError, Variant, VariantType, Bytes, \
IOCondition, IOChannel, SpawnFlags, \
- MAXUINT
+ MAXUINT, Mutex
-__all__ = ["create_main_loop", "create_new_context",
+__all__ = ["glib_mutex", "run_with_mutex",
+ "create_main_loop", "create_new_context",
"markup_escape_text", "format_size_full",
"timeout_add_seconds", "timeout_add", "idle_add",
"io_add_watch", "child_watch_add",
@@ -46,6 +47,9 @@ __all__ = ["create_main_loop", "create_new_context",
"MAXUINT"]
+glib_mutex = Mutex()
+
+
def create_main_loop():
"""Create GLib main loop.
@@ -59,3 +63,14 @@ def create_new_context():
:returns: GLib.MainContext."""
return MainContext.new()
+
+
+def run_with_mutex(func):
+ """run in glib mutex
+ """
+ def _call_method(*args, **kwargs):
+ glib_mutex.lock()
+ func(*args, **kwargs)
+ glib_mutex.unlock()
+ return _call_method
+
diff --git a/pyanaconda/payload/dnf/payload.py b/pyanaconda/payload/dnf/payload.py
index 45003da..0145a62 100644
--- a/pyanaconda/payload/dnf/payload.py
+++ b/pyanaconda/payload/dnf/payload.py
@@ -36,6 +36,7 @@ import libdnf.repo
import rpm
import re
import pyanaconda.localization
+import time
from blivet.size import Size
from dnf.const import GROUP_PACKAGE_TYPES
@@ -84,6 +85,7 @@ from pyanaconda.progress import progressQ, progress_message
from pyanaconda.simpleconfig import SimpleConfigFile
from pyanaconda.ui.lib.payload import get_payload, get_source, create_source, set_source, \
set_up_sources, tear_down_sources
+from pyanaconda.core.glib import glib_mutex
log = get_packaging_logger()
@@ -1327,10 +1329,15 @@ class DNFPayload(Payload):
pre_msg = (N_("Preparing transaction from installation source"))
progress_message(pre_msg)
- queue_instance = multiprocessing.Queue()
- process = multiprocessing.Process(target=do_transaction,
- args=(self._base, queue_instance))
- process.start()
+ while True:
+ if glib_mutex.trylock():
+ queue_instance = multiprocessing.Queue()
+ process = multiprocessing.Process(target=do_transaction,
+ args=(self._base, queue_instance))
+ process.start()
+ glib_mutex.unlock()
+ break
+ time.sleep(0.5)
(token, msg) = queue_instance.get()
# When the installation works correctly it will get 'install' updates
# followed by a 'post' message and then a 'quit' message.
diff --git a/pyanaconda/payload/dnf/utils.py b/pyanaconda/payload/dnf/utils.py
index dfac5c9..0d7c10c 100644
--- a/pyanaconda/payload/dnf/utils.py
+++ b/pyanaconda/payload/dnf/utils.py
@@ -27,6 +27,7 @@ from pyanaconda.progress import progressQ
from pyanaconda.core import util
from pyanaconda.core.configuration.anaconda import conf
from pyanaconda.product import productName, productVersion
+from pyanaconda.core.glib import glib_mutex
log = get_packaging_logger()
@@ -126,6 +127,7 @@ def do_transaction(base, queue_instance):
# always raise a BaseException, so presence of 'quit' without a preceeding
# 'post' message also indicates a problem.
try:
+ glib_mutex.unlock()
display = TransactionProgress(queue_instance)
base.do_transaction(display=display)
exit_reason = "DNF quit"
diff --git a/pyanaconda/ui/gui/spokes/installation_progress.py b/pyanaconda/ui/gui/spokes/installation_progress.py
index 0de742b..2ca0f67 100644
--- a/pyanaconda/ui/gui/spokes/installation_progress.py
+++ b/pyanaconda/ui/gui/spokes/installation_progress.py
@@ -29,6 +29,7 @@ from pykickstart.constants import KS_SHUTDOWN, KS_REBOOT
from pyanaconda.ui.gui.hubs.summary import SummaryHub
from pyanaconda.ui.gui.spokes import StandaloneSpoke
from pyanaconda.ui.gui.utils import gtk_call_once
+from pyanaconda.core.glib import run_with_mutex
log = get_module_logger(__name__)
@@ -185,12 +186,14 @@ class ProgressSpoke(StandaloneSpoke):
log.debug("The installation has started.")
+ @run_with_mutex
def _init_progress_bar(self, steps):
self._totalSteps = steps
self._currentStep = 0
gtk_call_once(self._progressBar.set_fraction, 0.0)
+ @run_with_mutex
def _step_progress_bar(self):
if not self._totalSteps:
return
@@ -198,6 +201,7 @@ class ProgressSpoke(StandaloneSpoke):
self._currentStep += 1
gtk_call_once(self._progressBar.set_fraction, self._currentStep/self._totalSteps)
+ @run_with_mutex
def _update_progress_message(self, message):
if not self._totalSteps:
return
--
2.23.0