TimeoutException is sometimes a misnomer
----------------------------------------
Key: JSPF-83
URL: https://issues.apache.org/jira/browse/JSPF-83
Project: JAMES jSPF
Issue Type: Improvement
Components: Core
Affects Versions: 1.0
Reporter: Casey Connor
Priority: Minor
TimeoutException is often created in jSPF code when an
org.xbill.DNS.Lookup.TRY_AGAIN code is returned, but the DNS.Lookup code
returns TRY_AGAIN in three cases (AFAIK):
if (badresponse) {
result = TRY_AGAIN;
error = badresponse_error;
done = true;
} else if (timedout) {
result = TRY_AGAIN;
error = "timed out";
done = true;
} else if (networkerror) {
result = TRY_AGAIN;
error = "network error";
done = true;
}
...thus it would seem that TimeoutException is a misnomer in 2 of the three
cases, rare though they may be. We saw this issue when our logs were showing
"timeout while querying server" type messages from jSPF, but in fact the
problem was misconfigured DNS records.
It was suggested that I recommend a patch. I'm too new to the code (and don't
have the time to give, unfortunately), so here's a probably-incomplete list of
suggestions (based off rev 808165) from a relatively-cursory look at the code:
- SPFRetriever line 64 changes to:
throw new TempErrorException("Network problem querying dns (timeout, bad
response, or other)");
- SPFRetriever line 101 to:
throw new TempErrorException("Network problem querying dns (timeout, bad
response, or other)");
-SPFStrictCheckerRetriever line 63 and 96, AMechanism line 260, MXMechanism
line 153, and PTRMechanism line 173 to:
throw new TempErrorException("Network problem querying dns (timeout, bad
response, or other)");
- rename TimeoutException to something like NetworkErrorException or
RecordQueryException, etc
I don't know if there are ramifications higher-up the call stack where other
logging happens based on a a TempErrorException or a TimeoutException
encapsulated in another object that triggers similar logging that needs to be
changed, or even programmatic decisions that should be altered.
Thanks,
-Casey
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]