1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-09 00:00:00 +01:00

super_node: Fix configuration of idle_stop setting

Signed-off-by: Steffen Vogel <post@steffenvogel.de>
This commit is contained in:
Steffen Vogel 2024-05-23 19:26:10 +02:00 committed by pipeacosta
parent 0ae86790b6
commit 550eb14758
2 changed files with 9 additions and 5 deletions

View file

@ -40,7 +40,7 @@ class SuperNode {
protected:
enum State state;
int idleStop;
bool idleStop;
Logger logger;

View file

@ -29,7 +29,7 @@ using namespace villas;
using namespace villas::node;
SuperNode::SuperNode()
: state(State::INITIALIZED), idleStop(-1),
: state(State::INITIALIZED), idleStop(false),
#ifdef WITH_API
api(this),
#endif
@ -80,7 +80,7 @@ void SuperNode::parse(json_t *root) {
json_error_t err;
idleStop = 1;
int stop = -1;
ret =
json_unpack_ex(root, &err, 0,
@ -89,11 +89,15 @@ void SuperNode::parse(json_t *root) {
"stats", &statsRate, "http", &json_http, "logging",
&json_logging, "nodes", &json_nodes, "paths", &json_paths,
"hugepages", &hugepages, "affinity", &affinity, "priority",
&priority, "idle_stop", &idleStop, "uuid", &uuid_str);
&priority, "idle_stop", &stop, "uuid", &uuid_str);
if (ret)
throw ConfigError(root, err, "node-config",
"Unpacking top-level config failed");
if (stop >= 0) {
idleStop = stop > 0;
}
if (uuid_str) {
ret = uuid_parse(uuid_str, uuid);
if (ret)
@ -455,7 +459,7 @@ int SuperNode::periodic() {
}
}
if (idleStop > 0 && state == State::STARTED && started == 0) {
if (idleStop && state == State::STARTED && started == 0) {
logger->info("No more active paths. Stopping super-node");
return -1;