hydra-queue-runner: Handle status queries on the main thread
[?]
Jun 17, 2015, 11:57 PM
XV4AEKJCFTNCOR52IRFYHORCNNFKIHOADIUARTC2U5Z6ZQBEEFYQCDependencies
- [2]
RQUAATWBAdd status dump facility - [3]
CCHPYTCPhydra-queue-runner: Handle $HYDRA_DBI - [4]
ATJ54SPXUse PostgreSQL notifications for queue events - [5]
NJJ7H64SVery basic multi-threaded queue runner - [*]
24BMQDZAStart of single-process hydra-queue-runner - [*]
C6HOMHZWDon't try to handle SIGINT - [*]
T2EIYJNGOn SIGINT, shut down the builder threads
Change contents
- edit in src/hydra-queue-runner/hydra-queue-runner.cc at line 83
}};struct receiver : public pqxx::notification_receiver{bool status = false;receiver(pqxx::connection_base & c, const std::string & channel): pqxx::notification_receiver(c, channel) { }void operator() (const string & payload, int pid) override{status = true;};bool get() {bool b = status;status = false;return b; - edit in src/hydra-queue-runner/hydra-queue-runner.cc at line 454
struct receiver : public pqxx::notification_receiver{bool status = false;receiver(pqxx::connection_base & c, const std::string & channel): pqxx::notification_receiver(c, channel) { }void operator() (const string & payload, int pid) override{status = true;};bool get() {bool b = status;status = false;return b;}}; - edit in src/hydra-queue-runner/hydra-queue-runner.cc at line 458
receiver dumpStatus(*conn, "dump_status"); - edit in src/hydra-queue-runner/hydra-queue-runner.cc at line 482
if (dumpStatus.get())State::dumpStatus(); - edit in src/hydra-queue-runner/hydra-queue-runner.cc at line 1314[8.92][9.771]
while (true) {try {auto conn(dbPool.get());receiver dumpStatus(*conn, "dump_status");while (true) {conn->await_notification();if (dumpStatus.get())State::dumpStatus();}} catch (std::exception & e) {printMsg(lvlError, format("main thread: %1%") % e.what());sleep(10); // probably a DB problem, so don't retry right away}} - edit in src/hydra-queue-runner/hydra-queue-runner.cc at line 1330[9.772][4.3479]
// Never reached.