[SNMP4J] TableUtils.getTable() doesn't return
Frank Fock
fock at agentpp.com
Tue Oct 25 02:03:26 CEST 2016
Hi Steffen,
I cannot imagine a standard conforming agent that will cause the
situation you
described, but anyway you are right, that there is a "hole" in the
algorithm of
TableUtils.
To fix it, you can replace the "relevant part in
TableRequest.onResponse" with
boolean sentChunk;
if (!(sentChunk = sendNextChunk())) {
if (anyMatch) {
sent =0;
anyMatch =false;
sentChunk = sendNextChunk();
}
if (!sentChunk) {
emptyCache();
finished =true;
listener.finished(new TableEvent(this,userObject));
}
}
Best regards,
Frank
Am 24.10.2016 um 18:36 schrieb Steffen Brüntjen:
> 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
>
> _______________________________________________
> SNMP4J mailing list
> SNMP4J at agentpp.org
> https://oosnmp.net/mailman/listinfo/snmp4j
--
---
AGENT++
Maximilian-Kolbe-Str. 10
73257 Koengen, Germany
https://agentpp.com
Phone: +49 7024 8688230
Fax: +49 7024 8688231
More information about the SNMP4J
mailing list