|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] [OSSTEST PATCH 14/32] daemons: Allow QueueDaemon and OwnerDaemon to run on different hosts
We want the OwnerDaemon to run on the same host as the database (for
fate-sharing reasons). OTOH the QueueDaemon is less critical if it
fails, and it generates reports etc., and wants to be more frequently
updated, so it should run on the osstest VM.
Permit this by:
* Providing OwnerDaemonHost and QueueDaemonHost config settings
which default to the value of ControlDaemonHost.
* Using those everywhere.
* In the daemons' Tcl code, have main-daemon take the string `Owner'
or `Queue' so that it can look up both the host and port.
Signed-off-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
---
Osstest/Executive.pm | 7 ++++++-
ms-ownerdaemon | 2 +-
ms-queuedaemon | 4 ++--
ms-reportuptime | 2 +-
tcl/JobDB-Executive.tcl | 2 +-
tcl/daemonlib.tcl | 5 +++--
6 files changed, 14 insertions(+), 8 deletions(-)
diff --git a/Osstest/Executive.pm b/Osstest/Executive.pm
index 3dc37d1..118a91a 100644
--- a/Osstest/Executive.pm
+++ b/Osstest/Executive.pm
@@ -100,6 +100,11 @@ augmentconfigdefaults(
BisectionRevisonGraphSize => '600x300',
);
+augmentconfigdefaults(
+ OwnerDaemonHost => $c{ControlDaemonHost},
+ QueueDaemonHost => $c{ControlDaemonHost},
+);
+
#---------- configuration reader etc. ----------
sub opendb_tests () {
@@ -241,7 +246,7 @@ sub alloc_resources_rollback_begin_work () {
our $alloc_resources_waitstart;
sub tcpconnect_queuedaemon () {
- my $qserv= tcpconnect($c{ControlDaemonHost}, $c{QueueDaemonPort});
+ my $qserv= tcpconnect($c{QueueDaemonHost}, $c{QueueDaemonPort});
$qserv->autoflush(1);
$_= <$qserv>; defined && m/^OK ms-queuedaemon\s/ or die "$_?";
diff --git a/ms-ownerdaemon b/ms-ownerdaemon
index 61b5ade..33ee238 100755
--- a/ms-ownerdaemon
+++ b/ms-ownerdaemon
@@ -89,7 +89,7 @@ proc banner {chan} {
return "OK ms-ownerdaemon"
}
-main-daemon $c(OwnerDaemonPort) {
+main-daemon Owner {
jobdb::db-open
jobdb::transaction resources {
diff --git a/ms-queuedaemon b/ms-queuedaemon
index 26d83e2..e15bc79 100755
--- a/ms-queuedaemon
+++ b/ms-queuedaemon
@@ -470,7 +470,7 @@ proc add-inhibit {why seconds} {
log "inhibition $why: starts, ${seconds}s, now $inhibit"
}
-main-daemon $c(QueueDaemonPort) {
+main-daemon Queue {
global owndchan chandesc inhibit plan
jobdb::db-open
@@ -484,7 +484,7 @@ main-daemon $c(QueueDaemonPort) {
# 1: run queue only if new resources available
# 2: definitely run queue
- set owndchan [socket $c(ControlDaemonHost) $c(OwnerDaemonPort)]
+ set owndchan [socket $c(OwnerDaemonHost) $c(OwnerDaemonPort)]
fconfigure $owndchan -buffering line -translation lf
set chandesc($owndchan) ownd
diff --git a/ms-reportuptime b/ms-reportuptime
index 9b376a7..aeac483 100755
--- a/ms-reportuptime
+++ b/ms-reportuptime
@@ -23,7 +23,7 @@ source daemonlib.tcl
readconfig
-set s [socket $c(ControlDaemonHost) $c(QueueDaemonPort)]
+set s [socket $c(QueueDaemonHost) $c(QueueDaemonPort)]
fconfigure $s -buffering line
set chandesc($s) qd
diff --git a/tcl/JobDB-Executive.tcl b/tcl/JobDB-Executive.tcl
index ad13cbd..430ea84 100644
--- a/tcl/JobDB-Executive.tcl
+++ b/tcl/JobDB-Executive.tcl
@@ -253,7 +253,7 @@ proc become-task {comment} {
global env c
if {[info exists env(OSSTEST_TASK)]} return
- set ownerqueue [socket $c(ControlDaemonHost) $c(OwnerDaemonPort)]
+ set ownerqueue [socket $c(OwnerDaemonHost) $c(OwnerDaemonPort)]
fconfigure $ownerqueue -buffering line -translation lf
must-gets $ownerqueue {^OK ms-ownerdaemon\M}
puts $ownerqueue create-task
diff --git a/tcl/daemonlib.tcl b/tcl/daemonlib.tcl
index c0e703d..d097624 100644
--- a/tcl/daemonlib.tcl
+++ b/tcl/daemonlib.tcl
@@ -184,10 +184,11 @@ proc newconn {chan addr port} {
}
}
-proc main-daemon {port setup} {
+proc main-daemon {which setup} {
global c argv
- set host $c(ControlDaemonHost)
+ set host $c(${which}DaemonHost)
+ set port $c(${which}DaemonPort)
foreach arg $argv {
switch -glob -- $arg {
--
1.7.10.4
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |