From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-commits+bounces-836529-garchives=archives.gentoo.org@lists.gentoo.org>
Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80])
	by finch.gentoo.org (Postfix) with ESMTP id 488FD13881D
	for <garchives@archives.gentoo.org>; Wed, 23 Sep 2015 22:32:59 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id BA532E0802;
	Wed, 23 Sep 2015 22:32:56 +0000 (UTC)
Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183])
	(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by pigeon.gentoo.org (Postfix) with ESMTPS id 5E422E0802
	for <gentoo-commits@lists.gentoo.org>; Wed, 23 Sep 2015 22:32:56 +0000 (UTC)
Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52])
	(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by smtp.gentoo.org (Postfix) with ESMTPS id 16A90340A3E
	for <gentoo-commits@lists.gentoo.org>; Wed, 23 Sep 2015 22:32:54 +0000 (UTC)
Received: from localhost.localdomain (localhost [127.0.0.1])
	by oystercatcher.gentoo.org (Postfix) with ESMTP id 958901F4
	for <gentoo-commits@lists.gentoo.org>; Wed, 23 Sep 2015 22:32:47 +0000 (UTC)
From: "Zac Medico" <zmedico@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Content-Transfer-Encoding: 8bit
Content-type: text/plain; charset=UTF-8
Reply-To: gentoo-dev@lists.gentoo.org, "Zac Medico" <zmedico@gentoo.org>
Message-ID: <1443047496.200d876b01dd11521cdcd9bfa07abdca165d24e8.zmedico@gentoo>
Subject: [gentoo-commits] proj/portage:master commit in: pym/portage/sync/
X-VCS-Repository: proj/portage
X-VCS-Files: pym/portage/sync/controller.py
X-VCS-Directories: pym/portage/sync/
X-VCS-Committer: zmedico
X-VCS-Committer-Name: Zac Medico
X-VCS-Revision: 200d876b01dd11521cdcd9bfa07abdca165d24e8
X-VCS-Branch: master
Date: Wed, 23 Sep 2015 22:32:47 +0000 (UTC)
Precedence: bulk
List-Post: <mailto:gentoo-commits@lists.gentoo.org>
List-Help: <mailto:gentoo-commits+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org>
X-BeenThere: gentoo-commits@lists.gentoo.org
X-Archives-Salt: 579df051-7b11-43d3-ad1e-ab24a7ea9b4a
X-Archives-Hash: a2ed4e05e3c752a6b6b041502668668a

commit:     200d876b01dd11521cdcd9bfa07abdca165d24e8
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Sep 23 16:16:45 2015 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Sep 23 22:31:36 2015 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=200d876b

SyncManager.async: initialize attributes before fork (bug 561234)

Since commit 496ff326dc18890889d1ea5d2aec590394635960, the pre_sync
method executes in a forked child process. Therefore, initialize
attributes before the fork (in the async method).

Fixes: 496ff326dc18 ("sync repositories in parallel (bug 557426)")
X-Gentoo-Bug: 561234
X-Gentoo-Bug-url: https://bugs.gentoo.org/show_bug.cgi?id=561234
Acked-by: Brian Dolbec <dolsen <AT> gentoo.org>

 pym/portage/sync/controller.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/pym/portage/sync/controller.py b/pym/portage/sync/controller.py
index e992cc4..28dbc57 100644
--- a/pym/portage/sync/controller.py
+++ b/pym/portage/sync/controller.py
@@ -115,13 +115,16 @@ class SyncManager(object):
 		return []
 
 	def async(self, emerge_config=None, repo=None):
+		self.emerge_config = emerge_config
+		self.settings, self.trees, self.mtimedb = emerge_config
+		self.xterm_titles = "notitles" not in self.settings.features
+		self.portdb = self.trees[self.settings['EROOT']]['porttree'].dbapi
 		proc = AsyncFunction(target=self.sync,
 			kwargs=dict(emerge_config=emerge_config, repo=repo))
 		proc.addExitListener(self._sync_callback)
 		return proc
 
 	def sync(self, emerge_config=None, repo=None):
-		self.emerge_config = emerge_config
 		self.callback = None
 		self.repo = repo
 		self.exitcode = 1
@@ -199,13 +202,10 @@ class SyncManager(object):
 
 
 	def pre_sync(self, repo):
-		self.settings, self.trees, self.mtimedb = self.emerge_config
-		self.xterm_titles = "notitles" not in self.settings.features
 		msg = ">>> Syncing repository '%s' into '%s'..." \
 			% (repo.name, repo.location)
 		self.logger(self.xterm_titles, msg)
 		writemsg_level(msg + "\n")
-		self.portdb = self.trees[self.settings['EROOT']]['porttree'].dbapi
 		try:
 			st = os.stat(repo.location)
 		except OSError: