From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 3F076138334 for ; Wed, 6 Jun 2018 03:23:00 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 0E954E0A01; Wed, 6 Jun 2018 03:22:59 +0000 (UTC) Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id AFF94E0A01 for ; Wed, 6 Jun 2018 03:22:58 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 5F859335C7D for ; Wed, 6 Jun 2018 03:22:56 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 9A4A92A2 for ; Wed, 6 Jun 2018 03:22:54 +0000 (UTC) From: "Zac Medico" 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" Message-ID: <1528255298.9e07f3a45c1b321edd07530b278498cb09f8983c.zmedico@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: pym/_emerge/ X-VCS-Repository: proj/portage X-VCS-Files: pym/_emerge/AbstractEbuildProcess.py pym/_emerge/EbuildBuild.py pym/_emerge/PackageUninstall.py X-VCS-Directories: pym/_emerge/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: 9e07f3a45c1b321edd07530b278498cb09f8983c X-VCS-Branch: master Date: Wed, 6 Jun 2018 03:22:54 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 2d4181cc-aa10-47ba-883a-6f0197429166 X-Archives-Hash: 12633a72a110cd766d69f22f104fde64 commit: 9e07f3a45c1b321edd07530b278498cb09f8983c Author: Zac Medico gentoo org> AuthorDate: Wed Jun 6 03:14:41 2018 +0000 Commit: Zac Medico gentoo org> CommitDate: Wed Jun 6 03:21:38 2018 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=9e07f3a4 _unlock_builddir_exit: fix cancel/returncode interaction When the _unlock_builddir_exit returncode parameter has not been specified, do not attempt to cancel the current task, since the task has already completed. This mirrors logic added to the Binpkg _unlock_builddir_exit method in the previous commit. Fixes: 937d0156aa06 ("CompositeTask: handle SIGINT/TERM cancelled futures (bug 657436)") Bug: https://bugs.gentoo.org/657436 pym/_emerge/AbstractEbuildProcess.py | 8 ++++++-- pym/_emerge/EbuildBuild.py | 4 ++-- pym/_emerge/PackageUninstall.py | 4 ++-- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/pym/_emerge/AbstractEbuildProcess.py b/pym/_emerge/AbstractEbuildProcess.py index 370cac529..af6429a00 100644 --- a/pym/_emerge/AbstractEbuildProcess.py +++ b/pym/_emerge/AbstractEbuildProcess.py @@ -412,7 +412,11 @@ class AbstractEbuildProcess(SpawnProcess): def _unlock_builddir_exit(self, unlock_future, returncode=None): # Normally, async_unlock should not raise an exception here. - unlock_future.result() + unlock_future.cancelled() or unlock_future.result() if returncode is not None: - self.returncode = returncode + if unlock_future.cancelled(): + self.cancelled = True + self._was_cancelled() + else: + self.returncode = returncode SpawnProcess._async_wait(self) diff --git a/pym/_emerge/EbuildBuild.py b/pym/_emerge/EbuildBuild.py index 8d264dd1c..ab5a4da74 100644 --- a/pym/_emerge/EbuildBuild.py +++ b/pym/_emerge/EbuildBuild.py @@ -354,12 +354,12 @@ class EbuildBuild(CompositeTask): def _unlock_builddir_exit(self, unlock_task, returncode=None): self._assert_current(unlock_task) - if unlock_task.cancelled: + if unlock_task.cancelled and returncode is not None: self._default_final_exit(unlock_task) return # Normally, async_unlock should not raise an exception here. - unlock_task.future.result() + unlock_task.future.cancelled() or unlock_task.future.result() if returncode is not None: self.returncode = returncode self._async_wait() diff --git a/pym/_emerge/PackageUninstall.py b/pym/_emerge/PackageUninstall.py index cb3413056..43210b4bc 100644 --- a/pym/_emerge/PackageUninstall.py +++ b/pym/_emerge/PackageUninstall.py @@ -116,12 +116,12 @@ class PackageUninstall(CompositeTask): def _unlock_builddir_exit(self, unlock_task, returncode=None): self._assert_current(unlock_task) - if unlock_task.cancelled: + if unlock_task.cancelled and returncode is not None: self._default_final_exit(unlock_task) return # Normally, async_unlock should not raise an exception here. - unlock_task.future.result() + unlock_task.future.cancelled() or unlock_task.future.result() if returncode is not None: self.returncode = returncode self._async_wait()