Queuebuilder does the wrong thing when PAS changes

Bug #65712 reported by Malcolm Cleaton
12
Affects Status Importance Assigned to Milestone
Launchpad itself
Fix Released
High
Celso Providelo

Bug Description

The queuebuilder has some incorrect logic in working out whether or not an existing build object satisfies the need for a build on an architecture.

The problem appears when:
- A build results in both some architecture specific and some architecture independent packages.
- A build for at least one arch has already been published.
- A change to PAS leads to a need for builds on more architectures than before.

At this point, the code incorrectly concludes that build X satisfies the need for a build of source package foo on arch bar, as there is already a binary package from source foo published on arch bar (the arch indep one). The previous code used to filter out *all* architecture independent published binaries when finding builds, but this relied on special handling in the queuebuilder to do the right thing for arch all source packages.

This special handling was removed during the refactoring, which lead to changes to the build finding method in SourcePackageRelease (getBuildByArch). As a result of being foolish, I "fixed" this method by removing the filter on architecture independent packages entirely, when in fact I should have removed it only for architecture independent source packages.

Longer term, we should kill the getBuildByArch method, and replace it with methods to locate builds of various types; callsites can then do what they know they want. Trying to do the right thing here for all cases is very fuzzy.

Tags: lp-soyuz
Changed in soyuz:
assignee: nobody → malcolmcleaton
importance: Undecided → High
status: Unconfirmed → In Progress
Revision history for this message
Christian Reis (kiko) wrote :

This is worth doing.

Changed in soyuz:
assignee: malcolmcleaton → cprov
status: In Progress → Confirmed
Revision history for this message
Celso Providelo (cprov) wrote :

SPR.getBuildByArch() is definitely broken.
When some architecture-indep binary gets published in all architectures (as expected) it suppress the lookup, returning the wrong build. Let's try an example:

Source krb5, https://launchpad.net/ubuntu/+source/krb5/1.4.3-5ubuntu0.4 (158366) produces krb5-doc_1.4.3-5ubuntu0.4_all.deb.

When this arch-indep binary is published the query issued by getBuildByArch('hppa', krb5_1.4.3-5ubuntu0.4) returns the i386 build:

launchpad_prod=> SELECT build.id from build, binarypackagerelease, binarypackagepublishinghistory where Build.id = BinaryPackageRelease.build AND BinaryPackageRelease.id = BinaryPackagePublishingHistory.binarypackagerelease AND BinaryPackagePublishingHistory.distroarchrelease = 21 AND BinaryPackagePublishingHistory.archive = 1 AND Build.sourcepackagerelease = 158366;
   id
--------
 353441
(1 row)

https://launchpad.net/ubuntu/+source/krb5/1.4.3-5ubuntu0.4/+build/353441

Celso Providelo (cprov)
Changed in soyuz:
status: Confirmed → In Progress
Revision history for this message
Celso Providelo (cprov) wrote :

RF 4954

Changed in soyuz:
status: In Progress → Fix Committed
Celso Providelo (cprov)
Changed in soyuz:
status: Fix Committed → Fix Released
Jonathan Lange (jml)
visibility: private → public
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.