cadc-registry: improve client error handling and retry behaviour#236
Conversation
deprecate lookups using authMethod and securityMethod update test config for new CADC reg server
|
|
||
| /** | ||
| * HTTP read timeout in milliseconds (default: 60000). | ||
| * HTTP read timeout in milliseconds (default: 30000). |
There was a problem hiding this comment.
readTimeout defaults to 6,000 not 30,000
This method sets readTimeout to the specified value, but it also sets readCapabilitiesTimeout to 5 * readTimeout, which does indeed default to 30,000.
The 5 * readTimeout bit is hard coded twice, once in the initialisation and once in this method, but it isn't mentioned in the comments.
Trying to find out where the 30,000 value in this debug statement came from.
2026-06-18 19:01:19.889[Test worker] DEBUG CachingFile - loadRemoteContent: https://ws.cadc-ccda.hia-iha.nrc-cnrc.gc.ca/argus/capabilities 3000/30000
https://github.com/opencadc/reg/actions/runs/27782591339/job/82210973963?pr=236#step:4:1117
There was a problem hiding this comment.
It is subtle to get a good/robust behaviour. I'm improving the javadocs to note these different timeouts.
That 3000/30000 will be a read of a capabilities document, which has the same 3000 connection timeout and 5*6000 = 30000 read timeout (I made read timeout longer than connection timeout because the main improvement I am after is to shorten the delays when a reg service or fronted proxy is offline). So that looks right to me.
|
Something that I missed when I was working on this.
but it calls potentially leaving Which implies that Is it is safe to assume that Hand crafted by a human, no AI used in this review. |
|
thnx for thorough look at this - error handling (and retry) is always a tricky bit to make generally right) I have declared and documented the core exceptions thrown by CachingFile.getContent(). Some are RuntimeExceptions but I sometimes declare them for clarity when the caller may want to differentiate between different failure modes but not know what to catch. I really wanted to capture some call history so that RegistryClient lookups wouldn't get stuck making even short blocking calls to a service that was down, but that bit is hard given how RegistryClient is used in code (instantiated in request thread, called, thrown away)... so for this PR I'm just trying to tighten up the behaviour. In that failure mode it is 2 attempts (max retries 1) so one of:
or if it is just the backend container down:
(which for our haproxy instances is roughly 7 + 1 + 7 = 15 sec, still a lot of blocking) In a future PR I will try something like
|
No description provided.