Fix a race that can cause hydra-queue-runner to ignore newly added builds
[?]
Jul 21, 2017, 12:25 PM
S2NXJOJE3V7PTXHA2HAHA5BUSNJRHZNXBWK7KSWTPGISWKXYMJDQCDependencies
- [2]
OG3Z3QGCNamespace cleanup - [3]
H4KMCXGUUse triggers for all notifications on Builds table changes - [4]
MHVIT4JYSplit hydra-queue-runner.cc more - [5]
RVHBV3B3Notify the queue runner when a build is deleted - [6]
PHX2HIVG* Store info about the build inputs in the build record. - [7]
ZK76B5ZZLoad the queue in order of global priority - [8]
73YR46NJhydra-queue-runner: Write directly to a binary cache - [9]
HJOEIMLRRefactor - [10]
RND7XFNHgetQueuedBuilds(): Periodically stop to handle priority bumps - [11]
DKJFD6JNProcess Nix API changes - [12]
WE5Q2NVIAllow build to be bumped to the front of the queue via the web interface - [*]
N22GPKYT* Put info about logs / build products in the DB. - [*]
TJK27WSBOpen the DB using Hydra::Model::DB->new - [*]
WQXF2T3Dhydra-evaluator: Don't require $HYDRA_CONFIG - [*]
DDGBLKENUpdate isCurrent properly - [*]
DDMYFZ5XFix the jobset unchanged check - [*]
D5QIOJGP* Move everything up one directory.
Change contents
- replacement in src/hydra-queue-runner/queue-monitor.cc at line 51
if (buildsAdded.get())if (auto lowestId = buildsAdded.get()) {lastBuildId = std::stoi(*lowestId) - 1; - edit in src/hydra-queue-runner/queue-monitor.cc at line 54
} - replacement in src/hydra-queue-runner/queue-monitor.cc at line 80
printMsg(lvlInfo, format("checking the queue for builds > %1%...") % lastBuildId);printInfo("checking the queue for builds > %d...", lastBuildId); - replacement in src/libhydra/db.hh at line 24
struct receiver : public pqxx::notification_receiverclass receiver : public pqxx::notification_receiver - replacement in src/libhydra/db.hh at line 26
bool status = false;std::experimental::optional<std::string> status;public: - edit in src/libhydra/db.hh at line 32
- replacement in src/libhydra/db.hh at line 35
status = true;status = payload; - replacement in src/libhydra/db.hh at line 37
bool get() {bool b = status;status = false;return b;std::experimental::optional<std::string> get() {auto s = status;status = std::experimental::nullopt;return s; - edit in src/script/hydra-eval-jobset at line 28
my $notifyAdded = $db->storage->dbh->prepare("notify builds_added, ?"); - edit in src/script/hydra-eval-jobset at line 725
# Wake up hydra-queue-runner.my $lowestId;while (my ($id, $x) = each %buildMap) {$lowestId = $id if $x->{new} && (!defined $lowestId || $id < $lowestId);}$notifyAdded->execute($lowestId) if defined $lowestId; - edit in src/sql/hydra.sql at line 236
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(); - file addition: upgrade-54.sql[19.3004]
drop trigger BuildsAdded on Builds;drop function notifyBuildsAdded();