[AGENT++] Lots of WARNING: Synchronized: recursive trylocking detected (id) messages

Frank Fock fock at agentpp.com
Thu Mar 5 00:51:25 CET 2015


Hi Steven,

Please find my comments inline below:



> On 04 Mar 2015, at 12:20, MATTY, Steven <steven.matty at astrium.eads.net> wrote:
> 
> Hi
> 
> I have recently updated from   agent++-3.5.31 / snmp++-3.2.25   to   agent++-4.0.2 / snmp++-3.3.4
> I also now use agentx++ in order to connect with the OSPF MIB from quagga's ospfd subagent.
> 
> I've noticed that when viewing a MIB table (using iReasoning) there is a burst of warning messages :
> 
> WARNING: Synchronized: recursive trylocking detected (id)!:
> 

There should not be a burst of warning message of this kind and they should not occur regularly.
In AgentX++ there are seldom situations where a subrequest is being reprocessed (i.e. for the next bulk repetition)
where a recursive lock can occur. In most other cases it indicates that there is a locking issue (lock acquired twice).
Not solving the issue can lead to locks that are released too early and therefore unwanted race conditions.

With the old pthread implementations this was not a problem, but the recent implementations use an optimization


> The table is cleared/recreated every 5 seconds by a worker thread and checked that the table is not in the middle of being updated when viewing table contents within the MIB Browser
> I've even tried removing lock_mib()/unlock_mib() and start_synch()/end_synch() calls when updating the table.

This should not be done. Updating a table without proper locking can crash the agent.

> 
> and also when doing repeated SNMP GET on an OID within our MIB (code generated by AgentX++ and not-modified)
> in a short timespan I also get these warnings.
> 
> Are they expected, and if not, indicative of a locking/sync issue somewhere?
> 

See above.
When you can send me the log of the agent with some debug level, then I could see if it is “normal” or not.

Best regards,
Frank

> I've tried building our agent without threads but it appears AgentX++ requires threads enabled :
> 
> ../include/agentx_pp/agentx++.h:33:2: error: #error AGENTPP_USE_THREAD_POOL must be defined in agent++.h of AGENT++ >= v3.5c
> ../include/agentx_pp/agentx_threads.h:28:2: error: #error "To use AgentX++ threads must be enabled in AGENT++"
> 
> (indeed it is not possible to build snmp++ if configured with -disable-threads :
> 
> /tmp/snmp++-3.3.4/include/snmp_pp/config_snmp_pp.h:79:5: error: #if with no expression
> 
> Regards
> 
> 
> Steve
> 
> 
> 
> This email (including any attachments) may contain confidential
> and/or privileged information or information otherwise protected
> from disclosure. If you are not the intended recipient, please
> notify the sender immediately, do not copy this message or any
> attachments and do not use it for any purpose or disclose its
> content to any person, but delete this message and any attachments
> from your system. Airbus Defence and Space Limited disclaims any and all liability if this email transmission was virus corrupted,
> altered or falsified.
> -o-
> Airbus Defence and Space Limited, Registered in England and Wales No. 2449259
> Registered Office:
> Gunnels Wood Road, Stevenage, Hertfordshire, SG1 2AS, England
> _______________________________________________
> AGENTPP mailing list
> AGENTPP at agentpp.org
> https://oosnmp.net/mailman/listinfo/agentpp



More information about the AGENTPP mailing list