diff options
author | Guillem Jover <guillem@debian.org> | 2014-10-22 14:04:30 +0200 |
---|---|---|
committer | Guillem Jover <guillem@debian.org> | 2014-10-23 00:17:40 +0200 |
commit | edeed5695089a283a0abffcf0044fc9bf1c3a0b8 (patch) | |
tree | f260553916dcc45d167175a3a4525bc8e8ec1464 /src | |
parent | e65a01f242a218828ec205467fb6203515fde48a (diff) | |
download | dpkg-edeed5695089a283a0abffcf0044fc9bf1c3a0b8.tar.gz |
dpkg: Make sure to always switch to the next dependtry after no progress
We might get into a situation where we are making no progress, and
dependencies_ok() is still telling us that we can make progress by
fixing some triggers awaited package, but if those packages require
a dependency cycle to be broken we will get stuck and not progress to
the next dependtry.
Add an additional hard limit where we will jump dependtry, in case we
are not making any progress. This is a safety net that was removed when
triggers got introduced, but that only became active when adding the
dependency checks to trigproc(), although it was never future-proof.
Regression introduced in commit 10440009b68f59eeed4cb1b56547e3cf356aa540
and commit e121d882c92099d1f1aa9eedd0c0e90806a44efa.
Closes: #766242, #766322
Diffstat (limited to 'src')
-rw-r--r-- | src/packages.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/packages.c b/src/packages.c index 290565157..67b18c060 100644 --- a/src/packages.c +++ b/src/packages.c @@ -217,7 +217,15 @@ void process_queue(void) { action_todo = cipaction->arg_int; - if (sincenothing++ > queue.length * 2 + 2) { + if (sincenothing++ > queue.length * 3 + 2) { + /* Make sure that even if we have exceeded the queue since not having + * made any progress, we are not getting stuck trying to progress by + * trigger processing, w/o jumping into the next dependtry. */ + dependtry++; + sincenothing = 0; + assert(dependtry <= 4); + } else if (sincenothing > queue.length * 2 + 2) { + /* XXX: This probably needs moving into a new dependtry instead. */ if (progress_bytrigproc && progress_bytrigproc->trigpend_head) { enqueue_package(pkg); pkg = progress_bytrigproc; |