Gentoo Archives: gentoo-portage-dev

From: Brian Dolbec <dolsen@g.o>
To: gentoo-portage-dev@l.g.o
Subject: Re: [gentoo-portage-dev] [PATCH v2] SyncManager.async: initialize attributes before fork (bug 561234)
Date: Wed, 23 Sep 2015 21:59:09
Message-Id: 20150923145810.26a91d7c.dolsen@gentoo.org
In Reply to: [gentoo-portage-dev] [PATCH v2] SyncManager.async: initialize attributes before fork (bug 561234) by Zac Medico
1 On Wed, 23 Sep 2015 12:14:05 -0700
2 Zac Medico <zmedico@g.o> wrote:
3
4 > Since commit 496ff326dc18890889d1ea5d2aec590394635960, the pre_sync
5 > method executes in a forked child process. Therefore, initialize
6 > attributes before the fork (in the async method).
7 >
8 > Fixes: 496ff326dc18 ("sync repositories in parallel (bug 557426)")
9 > X-Gentoo-Bug: 561234
10 > X-Gentoo-Bug-url: https://bugs.gentoo.org/show_bug.cgi?id=561234
11 > ---
12 > [PATCH v2] adds self.emerge_config to the initialized attributes
13 >
14 > pym/portage/sync/controller.py | 8 ++++----
15 > 1 file changed, 4 insertions(+), 4 deletions(-)
16 >
17 > diff --git a/pym/portage/sync/controller.py
18 > b/pym/portage/sync/controller.py index e992cc4..28dbc57 100644
19 > --- a/pym/portage/sync/controller.py
20 > +++ b/pym/portage/sync/controller.py
21 > @@ -115,13 +115,16 @@ class SyncManager(object):
22 > return []
23 >
24 > def async(self, emerge_config=None, repo=None):
25 > + self.emerge_config = emerge_config
26 > + self.settings, self.trees, self.mtimedb =
27 > emerge_config
28 > + self.xterm_titles = "notitles" not in
29 > self.settings.features
30 > + self.portdb =
31 > self.trees[self.settings['EROOT']]['porttree'].dbapi proc =
32 > AsyncFunction(target=self.sync,
33 > kwargs=dict(emerge_config=emerge_config, repo=repo))
34 > proc.addExitListener(self._sync_callback) return proc
35 >
36 > def sync(self, emerge_config=None, repo=None):
37 > - self.emerge_config = emerge_config
38 > self.callback = None
39 > self.repo = repo
40 > self.exitcode = 1
41 > @@ -199,13 +202,10 @@ class SyncManager(object):
42 >
43 >
44 > def pre_sync(self, repo):
45 > - self.settings, self.trees, self.mtimedb =
46 > self.emerge_config
47 > - self.xterm_titles = "notitles" not in
48 > self.settings.features msg = ">>> Syncing repository '%s' into
49 > '%s'..." \ % (repo.name, repo.location)
50 > self.logger(self.xterm_titles, msg)
51 > writemsg_level(msg + "\n")
52 > - self.portdb =
53 > self.trees[self.settings['EROOT']]['porttree'].dbapi try:
54 > st = os.stat(repo.location)
55 > except OSError:
56
57 OK, looks good
58
59 I suppose we'll need to do another release soon, but how long should we
60 wait...(new repoman code) or should we just patch 2.2.21
61
62 --
63 Brian Dolbec <dolsen>

Replies