[SNMP4J] DefaultTcpTransportMapping: socket disconnect causes timeouts for all

Ladd ladd at codemettle.com
Thu Jun 19 21:17:27 CEST 2014


> 
> Hi Ladd,
> 
> This fix could indeed improve the transport mappings behavior in some 
> situations!
> Thanks for sorting this out.
> The getFirst() calling is inefficient, because it takes several loops to 
> get all keys processed
> (they are removed from the list by other code). In the case of a dropped 
> connection,
> it should have worked too with the getFirst() because an exception would 
> have removed
> the key from the list.
> 
> Best regards,
> Frank
> 

In my case I had 2 pending entries.  The first was for the unconnected
socket and the second was for the connected one trying to send a poll out. 
So processPending's loop went around twice with the first guy and ignored
the second guy.  addRegistration(OP_CONNECT) was called twice and
addRegistration(OP_WRITE) was never called.

So the GET request to the "good" agent never got sent.  And the
selector.select() loop sat there quietly until the timer thread indicated a
timeout.  The timeout of course was expected since the GET request to the
"good" agent never got sent at all (which I verified with Wireshark).

- Ladd




More information about the SNMP4J mailing list