Index: pym/_emerge/Scheduler.py |
diff --git a/pym/_emerge/Scheduler.py b/pym/_emerge/Scheduler.py |
index fa4825cf2058bbbe24ba4690a61a95a332315b32..e4b6926c3a110150d824b42fdd2f5a812b39196d 100644 |
--- a/pym/_emerge/Scheduler.py |
+++ b/pym/_emerge/Scheduler.py |
@@ -317,10 +317,6 @@ class Scheduler(PollScheduler): |
Initialization structures used for dependency calculations |
involving currently installed packages. |
""" |
- # TODO: Replace the BlockerDB with a depgraph of installed packages |
- # that's updated incrementally with each upgrade/uninstall operation |
- # This will be useful for making quick and safe decisions with respect |
- # to aggressive parallelization discussed in bug #279623. |
self._set_graph_config(graph_config) |
self._blocker_db = {} |
for root in self.trees: |
@@ -329,6 +325,7 @@ class Scheduler(PollScheduler): |
pkg_cache=self._pkg_cache) |
else: |
fake_vartree = graph_config.trees[root]['vartree'] |
+ fake_vartree.sync() |
self._blocker_db[root] = BlockerDB(fake_vartree) |
def _destroy_graph(self): |
@@ -643,27 +640,20 @@ class Scheduler(PollScheduler): |
def _find_blockers(self, new_pkg): |
""" |
- Returns a callable which should be called only when |
- the vdb lock has been acquired. |
+ Returns a callable. |
""" |
def get_blockers(): |
- return self._find_blockers_with_lock(new_pkg, acquire_lock=0) |
+ return self._find_blockers_impl(new_pkg) |
return get_blockers |
- def _find_blockers_with_lock(self, new_pkg, acquire_lock=0): |
+ def _find_blockers_impl(self, new_pkg): |
if self._opts_ignore_blockers.intersection(self.myopts): |
return None |
- # Call gc.collect() here to avoid heap overflow that |
- # triggers 'Cannot allocate memory' errors (reported |
- # with python-2.5). |
- gc.collect() |
- |
blocker_db = self._blocker_db[new_pkg.root] |
blocker_dblinks = [] |
- for blocking_pkg in blocker_db.findInstalledBlockers( |
- new_pkg, acquire_lock=acquire_lock): |
+ for blocking_pkg in blocker_db.findInstalledBlockers(new_pkg): |
if new_pkg.slot_atom == blocking_pkg.slot_atom: |
continue |
if new_pkg.cpv == blocking_pkg.cpv: |
@@ -673,8 +663,6 @@ class Scheduler(PollScheduler): |
self.pkgsettings[blocking_pkg.root], treetype="vartree", |
vartree=self.trees[blocking_pkg.root]["vartree"])) |
- gc.collect() |
- |
return blocker_dblinks |
def _dblink_pkg(self, pkg_dblink): |
@@ -1527,6 +1515,8 @@ class Scheduler(PollScheduler): |
self._completed_tasks.add(pkg) |
self._unsatisfied_system_deps.discard(pkg) |
self._choose_pkg_return_early = False |
+ blocker_db = self._blocker_db[pkg.root] |
+ blocker_db.discardBlocker(pkg) |
def _merge(self): |