Hi,
I have an environment (Linux 4.19.317 snmp++-3.6.6 / agent++-4.7.2 / agentx++-2.6.1) with an AgentX Master Agent and a number of Sub Agents. I have enabled logging for each SubAgent. Their main loop is:
auto last_ping_time = std::chrono::high_resolution_clock::now();
while (agent_running && !static_cast<SubAgentXMib&>(*mib).get_agentx()->quit())
{
AgentXRequest *req = reqList.get()->receive(1);
if (req)
{
LOG_BEGIN(loggerModuleName, WARNING_LOG | 1);
LOG("PROCESSING REQUEST");
LOG_END;
mib->process_request(req);
LOG_BEGIN(loggerModuleName, WARNING_LOG | 1);
LOG("PROCESSED REQUEST");
LOG_END;
}
else if ((last_ping_time + std::chrono::seconds(5)) < std::chrono::high_resolution_clock::now())
{
LOG_BEGIN(loggerModuleName, WARNING_LOG | 1);
LOG("PINGING MASTER");
LOG_END;
static_cast<SubAgentXMib&>(*mib).ping_master();
LOG_BEGIN(loggerModuleName, WARNING_LOG | 1);
LOG("PINGED MASTER");
LOG_END;
last_ping_time = std::chrono::high_resolution_clock::now();
}
}
In my log files, I get a WARNING entry every 5 seconds. The pattern is always the same, e.g.
20260613.11:27:29: 139803331778304: (1)WARNING: PINGING MASTER
20260613.11:27:29: 139803331778304: (1)WARNING: PINGED MASTER
20260613.11:27:29: 139803331778304: (1)WARNING: PROCESSING REQUEST
20260613.11:27:29: 139803331778304: (1)WARNING: PROCESSED REQUEST
20260613.11:27:29: 139803374298880: (1)WARNING: Synchronized: unlock failed (id)(error)(wasLocked): (1037), (1), (0)
I’m unable to determine what path the process_request()is taking - but I would guess that it is processing a ping response from the Master Agent. I could increase logging levels, but I tend to get quite a flood. Based on the warning, is there any kind of locking that I should be doing prior to calling process_request()?
Note that there are other requests being processed which don’t result in a Synchronized: unlock failed warning - so it certainly seems tied to the ping_master() response. If I change the frequency of the ping, the WARNINGlog entries match that periodicity.
Any hints would be appreciated, thanks
Steve