summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArne H Juul <arnej27959@users.noreply.github.com>2021-05-28 15:04:02 +0200
committerGitHub <noreply@github.com>2021-05-28 15:04:02 +0200
commit24db5f1c9e0e407dc0aa45febfc7b8992c097a66 (patch)
tree4334151ba02993a604d7911bf9659c31ef295567
parent2743c65d18c2b78402a857a32ea45f96e147830a (diff)
parent978e21af187d2d98e18d81a39fe5114701898bd4 (diff)
Merge pull request #18024 from vespa-engine/arnej/cleanup-sentinel-startup-2
Arnej/cleanup sentinel startup 2
-rwxr-xr-xconfig-proxy/src/main/sh/vespa-config-ctl.sh1
-rw-r--r--configd/src/apps/sentinel/env.cpp12
-rw-r--r--configd/src/apps/sentinel/manager.cpp1
-rw-r--r--configd/src/apps/sentinel/manager.h4
-rw-r--r--configd/src/apps/sentinel/sentinel.cpp1
5 files changed, 5 insertions, 14 deletions
diff --git a/config-proxy/src/main/sh/vespa-config-ctl.sh b/config-proxy/src/main/sh/vespa-config-ctl.sh
index b4127cd337e..03c033e620b 100755
--- a/config-proxy/src/main/sh/vespa-config-ctl.sh
+++ b/config-proxy/src/main/sh/vespa-config-ctl.sh
@@ -92,7 +92,6 @@ cp="libexec/vespa/patches/configproxy:lib/jars/config-proxy-jar-with-dependencie
VESPA_LOG_LEVEL="all -debug -spam"
export VESPA_LOG_TARGET VESPA_LOG_LEVEL VESPA_LOG_CONTROL_DIR
-export VESPA_SENTINEL_PORT
mkdir -p "$LOGDIR"
mkdir -p "$VESPA_LOG_CONTROL_DIR"
diff --git a/configd/src/apps/sentinel/env.cpp b/configd/src/apps/sentinel/env.cpp
index 02df292a423..11ba20a18d5 100644
--- a/configd/src/apps/sentinel/env.cpp
+++ b/configd/src/apps/sentinel/env.cpp
@@ -30,11 +30,9 @@ Env::~Env() = default;
void Env::boot(const std::string &configId) {
LOG(debug, "Reading configuration for ID: %s", configId.c_str());
_cfgOwner.subscribe(configId, CONFIG_TIMEOUT_MS);
- if (_cfgOwner.checkForConfigUpdate()) {
- LOG_ASSERT(_cfgOwner.hasConfig());
- } else {
- throw InvalidConfigException("checkForConfigUpdate() failed");
- }
+ bool ok = _cfgOwner.checkForConfigUpdate();
+ // subscribe() should throw if something is not OK
+ LOG_ASSERT(ok && _cfgOwner.hasConfig());
const auto & cfg = _cfgOwner.getConfig();
LOG(config, "Booting sentinel '%s' with [stateserver port %d] and [rpc port %d]",
configId.c_str(), cfg.port.telnet, cfg.port.rpc);
@@ -61,10 +59,6 @@ void Env::statePort(int port) {
}
if (port == 0) {
port = 19098;
- const char *portString = getenv("VESPA_SENTINEL_PORT");
- if (portString) {
- port = strtoul(portString, nullptr, 10);
- }
}
if (_stateServer && port == _statePort) {
return; // ok already
diff --git a/configd/src/apps/sentinel/manager.cpp b/configd/src/apps/sentinel/manager.cpp
index d1d06c6039a..80dd2a3fda8 100644
--- a/configd/src/apps/sentinel/manager.cpp
+++ b/configd/src/apps/sentinel/manager.cpp
@@ -20,6 +20,7 @@ Manager::Manager(Env &env)
_services(),
_outputConnections()
{
+ doConfigure();
}
Manager::~Manager()
diff --git a/configd/src/apps/sentinel/manager.h b/configd/src/apps/sentinel/manager.h
index dabe1590d20..9d3d14c6aeb 100644
--- a/configd/src/apps/sentinel/manager.h
+++ b/configd/src/apps/sentinel/manager.h
@@ -49,13 +49,11 @@ private:
void handleRestarts();
void updateMetrics();
-
void terminateServices(bool catchable, bool printDebug = false);
-
+ void doConfigure();
public:
Manager(Env &env);
virtual ~Manager();
- void doConfigure();
bool terminate();
int doWork();
void updateActiveFdset(fd_set *fds, int *maxNum);
diff --git a/configd/src/apps/sentinel/sentinel.cpp b/configd/src/apps/sentinel/sentinel.cpp
index 53c9ae7fbc2..ed0e6c1cfe5 100644
--- a/configd/src/apps/sentinel/sentinel.cpp
+++ b/configd/src/apps/sentinel/sentinel.cpp
@@ -80,7 +80,6 @@ main(int argc, char **argv)
}
sentinel::Manager manager(environment);
- manager.doConfigure();
vespalib::steady_time lastTime = vespalib::steady_clock::now();
while (!stop()) {
try {