[SNMP4J] help - possible thread-unsafe code in snmp4j

Ali, Syed F Syed.Ali02 at ca.com
Mon Feb 4 20:41:51 CET 2013


Frank,

I agree with you that this may yield a very small benefit as it is just protecting against a theoretical agent bug. In fact, after thinking about it some more, it may not even be worth incurring the extra cost of synchronization to protect against such agent bugs. 

Thanks for your time.

Regards,
Syed

Syed F. Ali
CA Technologies
Sr Software Engineer
Tel:  +1 603 334 2111
Syed.Ali02 at ca.com



-----Original Message-----
From: Frank Fock <fock at agentpp.com>
Subject: Re: [SNMP4J] help - possible thread-unsafe code in snmp4j
To: snmp4j at agentpp.org
Message-ID: <51100277.4080304 at agentpp.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

Hi Syed,

Yes, it is true, that if an agent sends multiple reports concurrently and
a multi-threaded message dispatcher is used, more than 
"request.maxRequestStatus"
reports could be send back, because reading and incrementing the request
status is not synchronized.

However, this only happens if the agent violates the protocol or is 
misconfigured
(sending retries in very short intervals). I will add a synchronization 
on the
request.requestStatus for the next release - although I see only a very 
small benefit.

Best regards,
Frank




More information about the SNMP4J mailing list