Package: release.debian.org
Severity: serious
User: release.debian....@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

Reply via email to