[SNMP4J] Bug in Snmp.close()

Matt Brozowski brozow at opennms.org
Wed Jul 20 04:12:00 CEST 2005


I have been writing code that does SNMPv3 requests as part of a test  
case.  As I was testing, I has misconfigured my usmUser name and  
password so I was getting Report PDUs back indicating unknown user.  I  
had log messages in onResponse of my ResponseListener.  When I called  
Snmp.close() as a result of the Report I got a number of onResponse log  
messages indication an InterruptedException.  (Originally I didn't  
handle this correctly and attempted to call Snmp.close() again  
resulting in an infinitely recursive loop).  After looking the code  
over it seems like there is a problem here.

When the Report PDU comes in, the request is 'cancelled' by calling its  
cancel method, but it is not removed from the pendingRequests list.   
Therefore on close() these requests appear to still be pending and  
result in interruptedExceptions (not to mention they probably hang  
around for a very long time)

Matt
________________________________________________________________________ 
___
Matt Brozowski, OpenNMS Maintainer			Main:	+1 919 812 4984
The OpenNMS Group, Inc.					Fax:		+1 503 961 7746
Email: brozow at opennms.org					URL:	http://www.opennms.com




More information about the SNMP4J mailing list