Notify the queue runner when a build is deleted

[?]
Jul 8, 2015, 9:43 AM
RVHBV3B3RA3QTPQFCTICFFG5QGRUZ7EGXZNR4W2MOM2HPBHPZV7AC

Dependencies

  • [2] GKZN4UV7 Make the queue monitor more robust, and better debug output
  • [3] ATJ54SPX Use PostgreSQL notifications for queue events
  • [*] 24BMQDZA Start of single-process hydra-queue-runner
  • [*] N22GPKYT * Put info about logs / build products in the DB.
  • [*] PHX2HIVG * Store info about the build inputs in the build record.
  • [*] CLJQCY2X * Store info about all the build actions and allow them to be
  • [*] D5QIOJGP * Move everything up one directory.

Change contents

  • edit in src/hydra-queue-runner/hydra-queue-runner.cc at line 209
    [3.737]
    [3.737]
    receiver buildsDeleted(*conn, "builds_deleted");
  • replacement in src/hydra-queue-runner/hydra-queue-runner.cc at line 229
    [3.1229][3.1229:1266]()
    if (buildsCancelled.get()) {
    [3.1229]
    [2.707]
    if (buildsCancelled.get() || buildsDeleted.get()) {
  • edit in src/sql/hydra.sql at line 203
    [7.2529]
    [8.7122]
    #ifdef POSTGRESQL
    create function notifyBuildDeleted() returns trigger as $$
    begin
    execute 'notify builds_deleted';
    return null;
    end;
    $$ language plpgsql;
    create trigger BuildDeleted after delete on Builds
    for each row
    execute procedure notifyBuildDeleted();
    #endif
  • file addition: upgrade-35.sql (----------)
    [9.3004]
    create function notifyBuildDeleted() returns trigger as $$
    begin
    execute 'notify builds_deleted';
    return null;
    end;
    $$ language plpgsql;
    create trigger BuildDeleted after delete on Builds
    for each row
    execute procedure notifyBuildDeleted();