* In the scheduler, don't check if we've already done a build (except

[?]
Oct 7, 2009, 1:18 PM
CVDK3XJKQJVLCNJM5E5K2T7ZIIIBN3WLEK3ADBGQEPAOJ6FZTPNQC

Dependencies

  • [2] S6OISBQ3 * Mark the "current" builds in a jobset, i.e. those corresponding to
  • [3] S5PV6IIM * Represent jobs explicitly in the DB.
  • [4] L2E6EVE2 * Merged the Build and Job tables.
  • [5] XNCWZ7OT * Get the job priority from the meta.schedulingPriority attribute.
  • [6] 7YBYT2LQ
  • [7] LZO3C2KI * Hack around those SQLite timeouts: just retry the transaction.
  • [8] H7CNGK4O * Log evaluation errors etc. in the DB.
  • [*] UUGBVEGY * Development notes.
  • [*] AHTEIK7G * Added a maintainers field to the Builds table.
  • [*] N22GPKYT * Put info about logs / build products in the DB.

Change contents

  • edit in doc/dev-notes.txt at line 92
    [11.118]
    [10.4491]
    alter table builds add column isCurrent integer default 0;
  • replacement in src/script/hydra_scheduler.pl at line 276
    [3.5467][2.3561:4099]()
    # Have we already done this build (in this job)? Don't do it
    # again unless it has been garbage-collected. The latest
    # builds for each platforms are GC roots, so they shouldn't be
    # GCed. However, if a job has reverted to a previous state,
    # it's possible that a GCed build becomes current again. In
    # that case we have to rebuild it to ensure that it appears in
    # channels etc.
    my @previousBuilds = $jobInDB->builds->search({outPath => $outPath}, {order_by => "id"});
    [3.5467]
    [2.4099]
    # Don't add a build that has already been scheduled for this
    # job, or has been built but is still a "current" build for
    # this job. Note that this means that if the sources of a job
    # are changed from A to B and then reverted to A, three builds
    # will be performed (though the last one will probably use the
    # cached result from the first). This ensures that the builds
    # with the highest ID will always be the ones that we want in
    # the channels.
    # !!! Checking $drvPath doesn't take meta-attributes into
    # account. For instance, do we want a new build to be
    # scheduled if the meta.maintainers field is changed?
    my @previousBuilds = $jobInDB->builds->search({drvPath => $drvPath, isCurrent => 1});
  • replacement in src/script/hydra_scheduler.pl at line 289
    [2.4142][2.4142:5005]()
    foreach my $build (@previousBuilds) {
    if (!$build->finished) {
    print "already scheduled as build ", $build->id, "\n";
    $currentBuilds->{$build->id} = 1;
    return;
    }
    }
    if (isValidPath($outPath)) {
    print "already done as build ", $previousBuilds[0]->id, "\n";
    # Mark the previous build as "current" so that it will
    # appear in the "latest" channel for this
    # project/jobset/job.
    $previousBuilds[0]->update({iscurrent => 1});
    $currentBuilds->{$previousBuilds[0]->id} = 1;
    return;
    }
    print "already done as build ", $previousBuilds[0]->id,
    "; rebuilding because it was garbage-collected\n";
    [2.4142]
    [3.9666]
    print "already scheduled/built\n";
    $currentBuilds->{$_->id} = 1 foreach @previousBuilds;
    return;
  • replacement in src/script/hydra_scheduler.pl at line 293
    [3.9676][3.9676:9677]()
    [3.9676]
    [3.5600]
  • edit in src/script/hydra_scheduler.pl at line 452
    [2.5708][2.5708:5759]()
    print "current is ", $build->id, "\n";