commit:     79a46f6ebdc9dc2b9bec611c8b88037b2ffe43d6
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Apr  8 04:50:21 2020 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Apr  8 05:29:46 2020 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=79a46f6e

Revert "EbuildBuildDir: cancel current tasks for CancelledError"

This reverts commit 899d5e61010a85702e7c83506d2214ede179c964.

Bug: https://bugs.gentoo.org/716636
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 lib/_emerge/EbuildBuildDir.py | 46 +++++++++++++++----------------------------
 1 file changed, 16 insertions(+), 30 deletions(-)

diff --git a/lib/_emerge/EbuildBuildDir.py b/lib/_emerge/EbuildBuildDir.py
index f1c49f041..77dbff1fb 100644
--- a/lib/_emerge/EbuildBuildDir.py
+++ b/lib/_emerge/EbuildBuildDir.py
@@ -6,7 +6,6 @@ from _emerge.AsynchronousLock import AsynchronousLock
 import portage
 from portage import os
 from portage.exception import PortageException
-from portage.util.futures import asyncio
 from portage.util.futures.compat_coroutine import coroutine
 from portage.util.SlotObject import SlotObject
 
@@ -70,29 +69,22 @@ class EbuildBuildDir(SlotObject):
                                raise
 
                catdir_lock = AsynchronousLock(path=catdir, 
scheduler=self.scheduler)
-               builddir_lock = AsynchronousLock(path=dir_path, 
scheduler=self.scheduler)
-               try:
-                       yield catdir_lock.async_start()
-                       yield catdir_lock.async_wait()
+               yield catdir_lock.async_start()
+               yield catdir_lock.async_wait()
 
-                       self._assert_lock(catdir_lock)
+               self._assert_lock(catdir_lock)
 
-                       try:
-                               portage.util.ensure_dirs(catdir,
-                                       gid=portage.portage_gid,
-                                       mode=0o70, mask=0)
-                       except PortageException:
-                               if not os.path.isdir(catdir):
-                                       raise
-
-                       yield builddir_lock.async_start()
-                       yield builddir_lock.async_wait()
-               except asyncio.CancelledError:
-                       if catdir_lock.poll() is None:
-                               catdir_lock.cancel()
-                       if builddir_lock.poll() is None:
-                               builddir_lock.cancel()
-                       raise
+               try:
+                       portage.util.ensure_dirs(catdir,
+                               gid=portage.portage_gid,
+                               mode=0o70, mask=0)
+               except PortageException:
+                       if not os.path.isdir(catdir):
+                               raise
+
+               builddir_lock = AsynchronousLock(path=dir_path, 
scheduler=self.scheduler)
+               yield builddir_lock.async_start()
+               yield builddir_lock.async_wait()
 
                try:
                        self._assert_lock(builddir_lock)
@@ -121,14 +113,8 @@ class EbuildBuildDir(SlotObject):
                        self.settings.pop('PORTAGE_BUILDDIR_LOCKED', None)
                        catdir_lock = AsynchronousLock(
                                path=self._catdir, scheduler=self.scheduler)
-                       try:
-                               yield catdir_lock.async_start()
-                               yield catdir_lock.async_wait()
-                       except asyncio.CancelledError:
-                               if catdir_lock.poll() is None:
-                                       catdir_lock.cancel()
-                               raise
-
+                       yield catdir_lock.async_start()
+                       yield catdir_lock.async_wait()
                        if catdir_lock.returncode == os.EX_OK:
                                try:
                                        os.rmdir(self._catdir)

Reply via email to