Revert "counter_tick_core: don't lock if parallel-install"
authorZac Medico <zmedico@gentoo.org>
Sun, 15 May 2011 23:28:32 +0000 (16:28 -0700)
committerZac Medico <zmedico@gentoo.org>
Sun, 15 May 2011 23:28:32 +0000 (16:28 -0700)
This reverts commit 405ad9eed65393205ec28af8772f7ea45ce0371e.
The root problem is fixed by commit
8380ec9d7590a47b912e0d1e1db2ebb6049b903b.

pym/portage/dbapi/vartree.py

index 0f8eede1b311e1880aa27fde2e42849c7c8ff599..4d7e6b88302476c746b02d759de8067f14af0fb8 100644 (file)
@@ -815,18 +815,7 @@ class vardbapi(dbapi):
                """
                myroot = None
                mycpv = None
-               locked_vdb = False
-               if "parallel-install" not in self.settings.features:
-                       # If parallel-install is enabled, it's unsafe to
-                       # lock the vdb here because it can deadlock the
-                       # Scheduler by preventing it from servicing its
-                       # poll loop which is essential for at least a
-                       # couple of reasons:
-                       # 1) releasing locks held by the scheduler
-                       # 2) handling output of subprocesses so that they
-                       #    don't deadlock due to blocking on stdout
-                       self.lock()
-                       locked_vdb = True
+               self.lock()
                try:
                        counter = self.get_counter_tick_core() - 1
                        if self._cached_counter != counter:
@@ -840,8 +829,7 @@ class vardbapi(dbapi):
                                        write_atomic(self._counter_path, str(counter))
                                self._cached_counter = counter
                finally:
-                       if locked_vdb:
-                               self.unlock()
+                       self.unlock()
 
                return counter