Fix a race that can cause hydra-queue-runner to ignore newly added builds
As @dtzWill discovered, with the concurrent hydra-evaluator, there can be multiple active transactions adding builds to the database. As a result, builds can become visible in a non-monotonically increasing order, breaking the queue monitor's assumption that build IDs only go up. The fix is to have hydra-eval-jobset provide the lowest build ID it just added in the builds_added notification, and have the queue monitor check from there. Fixes #496.
This commit is contained in:
@ -233,9 +233,6 @@ create table Builds (
|
||||
|
||||
#ifdef POSTGRESQL
|
||||
|
||||
create function notifyBuildsAdded() returns trigger as 'begin notify builds_added; return null; end;' language plpgsql;
|
||||
create trigger BuildsAdded after insert on Builds execute procedure notifyBuildsAdded();
|
||||
|
||||
create function notifyBuildsDeleted() returns trigger as 'begin notify builds_deleted; return null; end;' language plpgsql;
|
||||
create trigger BuildsDeleted after delete on Builds execute procedure notifyBuildsDeleted();
|
||||
|
||||
|
Reference in New Issue
Block a user