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 502BC1382C5 for ; Sun, 29 Apr 2018 22:24:27 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 78251E0AFF; Sun, 29 Apr 2018 22:24:26 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (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 41FACE0AFF for ; Sun, 29 Apr 2018 22:24:26 +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 046B9335C99 for ; Sun, 29 Apr 2018 22:24:25 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 627C7288 for ; Sun, 29 Apr 2018 22:24:23 +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: <1525038067.4da425966a82bfbbb68908010995941a44b45598.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/SubProcess.py X-VCS-Directories: pym/_emerge/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: 4da425966a82bfbbb68908010995941a44b45598 X-VCS-Branch: master Date: Sun, 29 Apr 2018 22:24:23 +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: 58eb083a-b9d4-4322-931f-8e39aba6516c X-Archives-Hash: 443547455c9439feb5131eab5ed95419 commit: 4da425966a82bfbbb68908010995941a44b45598 Author: Zac Medico gentoo org> AuthorDate: Sun Apr 29 21:39:28 2018 +0000 Commit: Zac Medico gentoo org> CommitDate: Sun Apr 29 21:41:07 2018 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=4da42596 AbstractEbuildProcess: call_later asyncio compat (bug 591760) Use call_later for asyncio compatibility. Bug: https://bugs.gentoo.org/591760 pym/_emerge/AbstractEbuildProcess.py | 11 ++++------- pym/_emerge/SubProcess.py | 2 +- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/pym/_emerge/AbstractEbuildProcess.py b/pym/_emerge/AbstractEbuildProcess.py index 2ed175750..ccc3b8e32 100644 --- a/pym/_emerge/AbstractEbuildProcess.py +++ b/pym/_emerge/AbstractEbuildProcess.py @@ -37,7 +37,7 @@ class AbstractEbuildProcess(SpawnProcess): # doesn't hurt to be generous here since the scheduler # continues to process events during this period, and it can # return long before the timeout expires. - _exit_timeout = 10000 # 10 seconds + _exit_timeout = 10 # seconds # The EbuildIpcDaemon support is well tested, but this variable # is left so we can temporarily disable it if any issues arise. @@ -247,7 +247,7 @@ class AbstractEbuildProcess(SpawnProcess): if self._registered: # Let the process exit naturally, if possible. self._exit_timeout_id = \ - self.scheduler.timeout_add(self._exit_timeout, + self.scheduler.call_later(self._exit_timeout, self._exit_command_timeout_cb) def _exit_command_timeout_cb(self): @@ -258,17 +258,14 @@ class AbstractEbuildProcess(SpawnProcess): # being killed by a signal. self.cancel() self._exit_timeout_id = \ - self.scheduler.timeout_add(self._cancel_timeout, + self.scheduler.call_later(self._cancel_timeout, self._cancel_timeout_cb) else: self._exit_timeout_id = None - return False # only run once - def _cancel_timeout_cb(self): self._exit_timeout_id = None self._async_waitpid() - return False # only run once def _orphan_process_warn(self): phase = self.phase @@ -363,7 +360,7 @@ class AbstractEbuildProcess(SpawnProcess): SpawnProcess._async_waitpid_cb(self, *args, **kwargs) if self._exit_timeout_id is not None: - self.scheduler.source_remove(self._exit_timeout_id) + self._exit_timeout_id.cancel() self._exit_timeout_id = None if self._ipc_daemon is not None: diff --git a/pym/_emerge/SubProcess.py b/pym/_emerge/SubProcess.py index aa4778737..a37482ca4 100644 --- a/pym/_emerge/SubProcess.py +++ b/pym/_emerge/SubProcess.py @@ -16,7 +16,7 @@ class SubProcess(AbstractPollTask): # This is how much time we allow for waitpid to succeed after # we've sent a kill signal to our subprocess. - _cancel_timeout = 1000 # 1 second + _cancel_timeout = 1 # seconds def _poll(self): # Simply rely on _async_waitpid_cb to set the returncode.