[SNMP4J] TableUtils.getTable() doesn't return

Steffen Brüntjen Steffen.Bruentjen at macmon.eu
Mon Oct 24 18:36:54 CEST 2016


Hi!

I found a problem in the TableUtils class. I set maxNumColumnsPerPDU in my
TableUtils object to 1 (because one of the test devices returns results in
wrong lexicographic order). Then, in some cases the TableUtils method

		public List<TableEvent> getTable(Target target,
					OID[] columnOIDs,
					OID lowerBoundIndex,
					OID upperBoundIndex) {

doesn't return. It starts waiting for a notify() on InternalTableListener
which never comes.

This is the relevant part in TableRequest.onResponse:

		if (!sendNextChunk()) {
			if (anyMatch) {
				sent = 0;
				anyMatch = false;
				sendNextChunk();
			} else {
				emptyCache();
				finished = true;
				listener.finished(new TableEvent(this, userObject));
			}
		}

The problem arises when the second call of sendNextChunk() returns false.
And this is what's happening. In sendNextChunk(), the first false comes
from here:

		if (sent >= lastReceived.size()) {
			return false;
		}

The second false comes from here:

		sent += chunkSize;
		if (pdu.size() == 0) {
			return false;
		}
		sendRequest(pdu, target, sentColumns);


Best regards,
Steffen Brüntjen




More information about the SNMP4J mailing list