[SNMP4J] SNMPv3 Resend after report -> MPv3 cache GC'd

Terje MegÄrd terjemeg at gmail.com
Fri Aug 18 15:40:11 CEST 2006


Hi Frank,

The sendPdu method in the MessageDispatcherImpl creates a new
PduHandle when resending a message after report and this PduHandle is
used as a key in the WeakHashMap of the MPv3 cache. We have seen that
the PduHandle is GC'd in the WeakHashMap because there is no other
reference to it. The associated PduHandle in the pendingRequests
HashTable of the Snmp object is a different instance, but with the
same transactionID.

This is the same problem as reported by Fridjof Berlin.

The problem occurs frequently on fast computers and slow networks.

If I use Hashtable instead of WeakHashMap the problem disappears, but
I am not sure if it is safe to do so. Perhaps better to get hold of
the PduHandle from the pendingRequests, but it does not seem trivial.


Best regards
Terje



More information about the SNMP4J mailing list