Fix race in finishing builds that have been cancelled

[?]
Aug 7, 2015, 2:18 AM
X2LETBPI7VE2PT7SMFZH2X5I244IPBPIXMVLHN5TQIHAQPMQ2MQQC

Dependencies

  • [2] T5BIOVJE Add support for tracking custom metrics
  • [*] 24BMQDZA Start of single-process hydra-queue-runner
  • [*] HPJKBFZ4 Handle concurrent finishing of the same build
  • [*] 5AIYUMTB Basic remote building
  • [*] 62MQPRXC Pass null values to libpqxx properly

Change contents

  • edit in src/hydra-queue-runner/hydra-queue-runner.cc at line 213
    [5.1708]
    [6.14683]
    if (txn.parameterized("select 1 from Builds where id = $1 and finished = 0")(build->id).exec().empty()) return;
  • edit in src/hydra-queue-runner/hydra-queue-runner.cc at line 226
    [7.716]
    [4.18276]
    txn.parameterized("delete from BuildProducts where build = $1")(build->id).exec();
  • edit in src/hydra-queue-runner/hydra-queue-runner.cc at line 245
    [4.19015]
    [2.1332]
    txn.parameterized("delete from BuildMetrics where build = $1")(build->id).exec();