[AGENT++] [AGENTX++] Concurrency problem in masteragent

Frank Fock fock at agentpp.com
Wed May 4 01:59:44 CEST 2005


Hi Arne,

Thanks for reporting this one. I have been always unhappy with deleting
the request object within the RequestList::answer method which was the
root cause of those concurrency problems. I have fixed this now by
deleting the request object in a method called Mib::delete_request
which is called from Mib::finalize after removing the request from the
RequestList. MasterAgentXMib now locks the request when it receives
a response and releases the lock when either delete_request is called
or AgentX requests to the subagents are sent out. After further testing
I think a can publish new versions of AGENT++ and AgentX++ on
Thursday. You will then also need to upgrade SNMP++ because
we have moved the logging facilities to SNMP++.

Best regards,
Frank

Arne Albrecht wrote:

>Hi there,
>
>i think i found a bug in the AgentX++/Agent++ code:
>If a request affects two subagents and the response of these agents return
>quite at the same time,
>the masteragent might crash.
>If the two response threads pass MasterAgentXMib::process_ax_response() and
>finish, they both call MIB::finalize() -
>but the second thread will enter with an invalid pointer.
>
>A quick and dirty solution: keep the access to the RequestList syncronized
>until the process_ax_response() method exits.
>This seems to work, but cause recursive-locking warnings.
>
>Regards,
>    Arne
>
>_______________________________________________
>AGENTPP mailing list
>AGENTPP at agentpp.org
>http://lists.agentpp.org/mailman/listinfo/agentpp
>
>  
>





More information about the AGENTPP mailing list