[SNMP4J] possible concurrent modification exception in UsmUserTable?

Aaron Loyd dfl789 at yahoo.com
Wed Aug 24 17:19:19 CEST 2011


No stack trace, we were just searching for why multiple v3 queries on different threads would sometimes work and sometimes time out.

UsmUserTable.java has methods "setUsers" and "getUserEntries" that have iterators.  If those methods are called while another call to "addUser" or "removeUser" is made there could be a CME.  However, this does not appear to be our issue.  We made sure all of our "addUser" calls were made before any queries and the problem still exists.

Thanks,
Aaron



--- On Tue, 8/23/11, snmp4j-request at agentpp.org <snmp4j-request at agentpp.org> wrote:

> From: snmp4j-request at agentpp.org <snmp4j-request at agentpp.org>
> Subject: SNMP4J Digest, Vol 91, Issue 11
> To: snmp4j at agentpp.org
> Date: Tuesday, August 23, 2011, 4:00 AM
> Send SNMP4J mailing list submissions
> to
>     snmp4j at agentpp.org
> 
> To subscribe or unsubscribe via the World Wide Web, visit
>     http://lists.agentpp.org/mailman/listinfo/snmp4j
> or, via email, send a message with subject or body 'help'
> to
>     snmp4j-request at agentpp.org
> 
> You can reach the person managing the list at
>     snmp4j-owner at agentpp.org
> 
> When replying, please edit your Subject line so it is more
> specific
> than "Re: Contents of SNMP4J digest..."
> 
> 
> Today's Topics:
> 
>    1. Re: possible concurrent modification
> exception in
>       UsmUserTable? (Frank Fock)
> 
> 
> ----------------------------------------------------------------------
> 
> Message: 1
> Date: Tue, 23 Aug 2011 00:08:43 +0200
> From: Frank Fock <fock at agentpp.com>
> Subject: Re: [SNMP4J] possible concurrent modification
> exception in
>     UsmUserTable?
> To: snmp4j at agentpp.org
> Message-ID: <4E52D36B.10001 at agentpp.com>
> Content-Type: text/plain; charset=ISO-8859-1;
> format=flowed
> 
> Hi,
> 
> I do not see where there is an Iterator involved.
> Do you have a stack trace?
> 
> Best regards,
> Frank
> 
> On 19.08.2011 01:51, Aaron Loyd wrote:
> >
> > The UsmUserTable class uses the not thread safe
> TreeMap.  It seems that if one
> > thread were to do snmp.getUSM().addUser() while
> another thread were doing
> > getUser() the iterator would throw a
> ConcurrentModificationException.
> >
> > We see that if we run two or more threads to do SNMPv3
> queries, sometimes one or
> > more of the queries will simply time out and not
> return any data but sometimes
> > succeed.
> >
> > _______________________________________________
> > SNMP4J mailing list
> > SNMP4J at agentpp.org
> > http://lists.agentpp.org/mailman/listinfo/snmp4j
> 
> -- 
> AGENT++
> http://www.agentpp.com
> http://www.snmp4j.com
> http://www.mibexplorer.com
> http://www.mibdesigner.com
> 
> 
> 
> ------------------------------
> 
> _______________________________________________
> SNMP4J mailing list
> SNMP4J at agentpp.org
> http://lists.agentpp.org/mailman/listinfo/snmp4j
> 
> 
> End of SNMP4J Digest, Vol 91, Issue 11
> **************************************
> 



More information about the SNMP4J mailing list