InterruptedExceptions thrown when using SNMP

Description

Numerous InterruptedException errors can appear when performing SNMP data collection, polling, provisioning, etc...

These show up in the log files as follows:

2016-10-17 12:48:24,412 WARN [DefaultUDPTransportMapping_0.0.0.0/0] o.s.t.DefaultUdpTransportMapping: java.lang.InterruptedException

There are additional details in https://opennms.atlassian.net/browse/NMS-8620#icft=NMS-8620.

Acceptance / Success Criteria

None

Lucidchart Diagrams

Activity

Show:

Jesse White November 22, 2016 at 7:29 AM

Jesse White November 21, 2016 at 9:28 AM

Jesse White October 17, 2016 at 12:57 PM
Edited

Based on my observations, this occurs on every call to the Snmp4JWalker, and has no negative effects, aside from printing the warning message in the log.

I suspect that this has been occurring since we updated SNMP4J in https://opennms.atlassian.net/browse/NMS-8226#icft=NMS-8226 from 2.3.1 to 2.4.3.
(I've confirmed that this log statement was not present in 2.3.1)

Jesse White October 17, 2016 at 12:54 PM

Here is a stacktrace of a breakpoint on LOG statement:

Daemon Thread [DefaultUDPTransportMapping_0.0.0.0/0] (Suspended (breakpoint at line 154 in DefaultUdpTransportMapping)) DefaultUdpTransportMapping.close() line: 154 Snmp.close() line: 562 Snmp4JWalker.close() line: 236 Snmp4JWalker(SnmpWalker).finish() line: 161 Snmp4JWalker(SnmpWalker).handleDone() line: 105 Snmp4JWalker(SnmpWalker).buildAndSendNextPdu() line: 94 Snmp4JWalker.access$800(Snmp4JWalker) line: 48 Snmp4JWalker$Snmp4JResponseListener.processResponse(PDU) line: 155 Snmp4JWalker$Snmp4JResponseListener.onResponse(ResponseEvent) line: 180 Snmp.processPdu(CommandResponderEvent) line: 1273 MessageDispatcherImpl.fireProcessPdu(CommandResponderEvent) line: 691 MessageDispatcherImpl.dispatchMessage(TransportMapping, MessageProcessingModel, Address, BERInputStream, TransportStateReference) line: 310 MessageDispatcherImpl.processMessage(TransportMapping, Address, BERInputStream, TransportStateReference) line: 387 MessageDispatcherImpl.processMessage(TransportMapping, Address, ByteBuffer, TransportStateReference) line: 347 DefaultUdpTransportMapping(AbstractTransportMapping<A>).fireProcessMessage(Address, ByteBuffer, TransportStateReference) line: 76 DefaultUdpTransportMapping$ListenThread.run() line: 425 Thread.run() line: 745

The problem is that we try closing the SNMP4J transport within the fireProcessMessage() callback: after issuing the fireProcessMessage() call, the listener is stopped normally, but we end up trying to close it before it reaches this point, leading to the observed exception.

Fixed

Details

Assignee

Reporter

Sprint

Priority

PagerDuty

Created October 17, 2016 at 9:14 AM
Updated November 29, 2016 at 4:34 PM
Resolved November 29, 2016 at 1:44 PM