Share

dnsjnio

Tracker: Patches

5 LookupAsynch NPE on late response - ID: 1845596
Last Update: Settings changed ( alexd_nom )

When the ExtendedNonblockingResolver timeout is set to small amount and
LookupAsynch is used as the resolver it happens to hit an NPE in the
ProcessingTask runnable.

Basically, like the ExtendedNonblockingResolver manage this scenario with a
System.err.println("DNSJNIO ExtendedNonblockingResolver ERROR -
ProcessResponse ignoring good response due to no known request"); we have
to do something similar in LookupAsynch changing the ProcessingTask code to



private final static class ProcessingTask implements Runnable {
public void run() {
while (true) {
LookupAsynch pendingLookup;
Response response;
synchronized(responseQueue) {
response = responseQueue.getItem();
System.err.println("removing "+response.getId());
pendingLookup = (LookupAsynch)
pendingLookups.remove(response.getId());
}
// if we already received an answer to this lookup:
--> if (pendingLookup != null) {
LookupContinuation lc =
pendingLookup.processResponse(response);
synchronized (pendingLookup) {
if (lc == null) {
pendingLookup.completeLookup();
pendingLookup.notify();
} else {
pendingLookup.submitQuery(lc);
}
}
--> } else {
--> System.err.println("FAILED removing
"+response.getId()+": NOT FOUND");
--> }
}
}
}


if null is returned the pendingLookup.processResponse will otherwise throw
an Null Pointer Exception.


Stefano Bagnara ( bago75 ) - 2007-12-06 15:47

5

Closed

Accepted

Nobody/Anonymous

None

None

Public


Comments




Log in to comment.

No follow-up comments have been posted.

Attached File

No Files Currently Attached

Changes ( 4 )

Field Old Value Date By
data_type 948814 2007-12-07 12:30 alexd_nom
status_id Open 2007-12-07 12:30 alexd_nom
resolution_id None 2007-12-07 12:30 alexd_nom
close_date - 2007-12-07 12:30 alexd_nom