--- Begin Message ---
- To: submit@bugs.debian.org
- Subject: britney crashes when trying removal multiple times
- From: Ivo De Decker <ivodd@debian.org>
- Date: Mon, 25 Nov 2019 15:21:47 +0100
- Message-id: <20191125142145.GA16126@debian.org>
Package: release.debian.org
Severity: serious
User: release.debian.org@packages.debian.org
Usertags: britney
Hi,
When a removal is done during an easy hint, the removal is tried again
afterwards, causing a crash.
There is a testcase for this in the testsuite (test takeover-removal-easy).
A workaround would be to throw an exception in this case:
https://salsa.debian.org/release-team/britney2/merge_requests/31
The root cause is that items that migrate due to the easy hint, are tried
again during the main run. This started with commit
6174d2c3f9590eba90f9c6dd613a553edd3a80e6
After this commit, the 'selected' items are no longer removed from
self.upgrade_me, because the items are represented by different objects in
both cases:
self.upgrade_me = [x for x in self.upgrade_me if x not in set(selected)]
https://salsa.debian.org/release-team/britney2/blob/master/britney.py#L1113
Example (from test takeover-removal-easy): both contain 'linux/5.3-1' and
'-linux-latest/10', but the objects are different:
selected: [<britney2.migrationitem.MigrationItem object at 0x7f09d578ab38>, <britney2.migrationitem.MigrationItem object at 0x7f09d578aba8>]
upgrade_me: [<britney2.migrationitem.MigrationItem object at 0x7f09d578ae48>, <britney2.migrationitem.MigrationItem object at 0x7f09d578a9e8>]
The commit mentioned above might have caused similar issues elsewhere in the
code.
Note that, for test takeover-removal-easy, not only '-linux-latest/10' is
tried again, but also 'linux/5.3-1'. For the latter, all binaries are removed
and added again when it 'migrates' for the second time. There are probably
corner cases where this would also cause unwanted behaviour.
In addition to a fix, it might be useful to extend the testsuite to discover
unexpected behaviour like this. One step could be to make the tests fail if a
MigrationConstraintException is triggered (except for tests where this is
explicitly allowed, because they are designed to trigger it). Also, the
consistency checks could be extended to check the validity of upgrade_me wrt
the current state of testing.
Comments welcome...
Ivo
--- End Message ---
--- Begin Message ---
- To: Ivo De Decker <ivodd@debian.org>
- Cc: 945471-done@bugs.debian.org
- Subject: Re: britney crashes when trying removal multiple times
- From: Ivo De Decker <ivodd@debian.org>
- Date: Thu, 6 Feb 2020 12:54:47 +0100
- Message-id: <20200206115444.GA4661@debian.org>
- In-reply-to: <20200116162748.GA28975@debian.org>
- References: <20191125142145.GA16126@debian.org> <20200116162748.GA28975@debian.org>
Hi,
On Thu, Jan 16, 2020 at 05:27:51PM +0100, Ivo De Decker wrote:
> The root cause of the issue is that the MigrationItem object can be versioned
> or unversioned. When comparing a versioned to an unversioned item from the
> same source, they match, however, the hashing function will return a different
> value. So whenever a set is used, this goes wrong. The way to fix this is to
> make all (relevant) migrationitems versioned and don't allow unversioned
> migration items to be hashed.
This is fixed in commit 62c309da074f24328bf55298288fc2569ac1d7fd.
Ivo
--- End Message ---