From 4d144d99fce5e3091cb501d65ba71075bf8a2971 Mon Sep 17 00:00:00 2001 From: Santiago Gimeno Date: Fri, 5 Jan 2024 21:29:28 +0100 Subject: [PATCH] agents: apply the correct config on zmq with SaaS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Make sure tracing config is correctly applied after the command handshake has been performed. Also, setup correctly the `blockedLoopThreshold` on both cases: connection to SaaS or to a standalone Console. PR-URL: https://github.com/nodesource/nsolid/pull/59 Reviewed-by: Trevor Norris Reviewed-by: Juan José Arboleda --- agents/zmq/src/zmq_agent.cc | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/agents/zmq/src/zmq_agent.cc b/agents/zmq/src/zmq_agent.cc index 46e066d7fe..6dcb890100 100644 --- a/agents/zmq/src/zmq_agent.cc +++ b/agents/zmq/src/zmq_agent.cc @@ -1431,6 +1431,10 @@ int ZmqAgent::config(const json& config) { } } + if (utils::find_any_fields_in_diff(diff, { "/blockedLoopThreshold" })) { + setup_blocked_loop_hooks(); + } + // Return early if command handle is not to be configured if (command_handle_ == nullptr) { return 0; @@ -1454,12 +1458,9 @@ int ZmqAgent::config(const json& config) { } } - if (utils::find_any_fields_in_diff(diff, { "/blockedLoopThreshold" })) { - setup_blocked_loop_hooks(); - } - // Configure tracing flags - if (utils::find_any_fields_in_diff(diff, { "/tracingEnabled", + if (tracer_ == nullptr || + utils::find_any_fields_in_diff(diff, { "/tracingEnabled", "/tracingModulesBlacklist" })) { auto it = config_.find("tracingEnabled"); if (it != config_.end()) {