From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1QPTvf-0002lt-5z for garchives@archives.gentoo.org; Thu, 26 May 2011 06:20:19 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 944C71C4ED; Thu, 26 May 2011 06:18:29 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 63D131C4ED for ; Thu, 26 May 2011 06:18:29 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 2D4211B4033 for ; Thu, 26 May 2011 06:18:29 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id 8A7BE8050A for ; Thu, 26 May 2011 06:18:28 +0000 (UTC) From: "Zac Medico" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Zac Medico" Message-ID: <6c419c4b44a29efb22f37fd8f596043ef709395e.zmedico@gentoo> Subject: [gentoo-commits] proj/portage:2.1.9 commit in: pym/_emerge/ X-VCS-Repository: proj/portage X-VCS-Files: pym/_emerge/AsynchronousLock.py X-VCS-Directories: pym/_emerge/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: 6c419c4b44a29efb22f37fd8f596043ef709395e Date: Thu, 26 May 2011 06:18:28 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: X-Archives-Hash: 6feeb70f7a49a3756ea87d8a1d56c041 commit: 6c419c4b44a29efb22f37fd8f596043ef709395e Author: Zac Medico gentoo org> AuthorDate: Mon May 16 06:17:27 2011 +0000 Commit: Zac Medico gentoo org> CommitDate: Thu May 26 03:04:06 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/portage.git;a= =3Dcommit;h=3D6c419c4b _LockProcess: handle process failure if cancelled --- pym/_emerge/AsynchronousLock.py | 13 ++++++++++--- 1 files changed, 10 insertions(+), 3 deletions(-) diff --git a/pym/_emerge/AsynchronousLock.py b/pym/_emerge/AsynchronousLo= ck.py index 6fa2bf6..b62b684 100644 --- a/pym/_emerge/AsynchronousLock.py +++ b/pym/_emerge/AsynchronousLock.py @@ -176,7 +176,7 @@ class _LockProcess(AbstractPollTask): """ =20 __slots__ =3D ('path', 'scheduler',) + \ - ('_proc', '_files', '_reg_id') + ('_proc', '_files', '_reg_id', '_unlocked') =20 def _start(self): in_pr, in_pw =3D os.pipe() @@ -201,8 +201,14 @@ class _LockProcess(AbstractPollTask): os.close(in_pw) =20 def _proc_exit(self, proc): - if proc.returncode !=3D os.EX_OK: - # There's no good reason for locks to fail. + if proc.returncode !=3D os.EX_OK and \ + not self.cancelled and \ + not self._unlocked: + # Typically, lock process failure should only happen + # if it's killed by a signal. We don't want lost + # locks going unnoticed, so it's only safe to ignore + # if either the cancel() or unlock() methods have + # been previously called. raise AssertionError('lock process failed with returncode %s' \ % (proc.returncode,)) =20 @@ -244,6 +250,7 @@ class _LockProcess(AbstractPollTask): raise AssertionError('not locked') if self.returncode is None: raise AssertionError('lock not acquired yet') + self._unlocked =3D True self._files['pipe_out'].write(b'\0') self._files['pipe_out'].close() self._files =3D None