Prevent multiple builds with the same (job, outPath) tuple from being added

[?]
Apr 2, 2012, 3:56 PM
JOYONH2KARKK2Z72WQW6DZ4B6WT47Z4VHOHGL7KM3B6RT3CBAMLQC

Dependencies

  • [2] RXVJFQ5A Evaluator cleanups
  • [3] OOQ2D3KC * Refactoring: move fetchInput out of hydra_scheduler into a separate
  • [4] 3XTHEUMP * Implemented the clone feature.
  • [5] JZE7DC2F Whitespace
  • [6] RFE6T5LG * Store jobset evaluations in the database explicitly. This includes
  • [7] FM4O2L4M hydra: if evaluator sees cached build, also add the buildproducts
  • [*] LBNVQXUB * Build the /build stuff in a separate controller.
  • [*] A22P7HCO hydra: at evaluation, check if path is already built, and mark as built in stead of adding to the queue.
  • [*] N22GPKYT * Put info about logs / build products in the DB.
  • [*] S5PV6IIM * Represent jobs explicitly in the DB.

Change contents

  • replacement in src/lib/Hydra/Controller/Build.pm at line 535
    [3.1031][2.0:66]()
    $inputInfo, $nixExprInput, $job, \%currentBuilds, undef);
    [3.1031]
    [3.1090]
    $inputInfo, $nixExprInput, $job, \%currentBuilds, undef, {});
  • replacement in src/lib/Hydra/Helper/AddBuilds.pm at line 806
    [3.3507][2.395:494]()
    my ($db, $project, $jobset, $inputInfo, $nixExprInput, $buildInfo, $buildIds, $prevEval) = @_;
    [3.3507]
    [3.3600]
    my ($db, $project, $jobset, $inputInfo, $nixExprInput, $buildInfo, $buildIds, $prevEval, $jobOutPathMap) = @_;
  • edit in src/lib/Hydra/Helper/AddBuilds.pm at line 847
    [3.5175]
    [10.402]
    # Prevent multiple builds with the same (job, outPath) from
    # being added.
    my $prev = $$jobOutPathMap{$job->name . "\t" . $outPath};
    if (defined $prev) {
    print STDERR " already scheduled as build ", $prev, "\n";
    return;
    }
  • edit in src/lib/Hydra/Helper/AddBuilds.pm at line 897
    [2.1542]
    [3.6007]
    $$jobOutPathMap{$job->name . "\t" . $outPath} = $build->id;
  • edit in src/script/hydra-evaluator at line 126
    [3.5575]
    [12.5887]
    my $jobOutPathMap = {};
  • replacement in src/script/hydra-evaluator at line 143
    [2.2411][2.2411:2515]()
    checkBuild($db, $project, $jobset, $inputInfo, $nixExprInput, $job, \%buildIds, $prevEval);
    [2.2411]
    [3.5911]
    checkBuild($db, $project, $jobset, $inputInfo, $nixExprInput, $job, \%buildIds, $prevEval, $jobOutPathMap);