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.
Nobody/Anonymous
None
None
Public
| 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 |
Copyright © 2009 Geeknet, Inc. All rights reserved. Terms of Use