I noticed the Rocky framework doesn’t accept different timeout values from the default. When checking the code on github, I noticed the following :
"init": function(settings = {}) {
// Set defaults on a re-call
_setDefaults();
// Initialize settings, checking values as appropriate
if ("timeout" in settings && typeof settings.timeout == "bool") _timeout = settings.timeout;
This looks like a bug. timeout is supposed to be an integer or a float in seconds, but it is only assigned to the field _timeout when type is a ‘bool’ (i.e. never…)
Looks like dangerous coding as well to put the check for key in a table together with using that very key in a logical if clause…I would normally do these checks sequentially, but that may be just me being overly cautious
Haven’t checked the lib code yet in detail, but I have the impression that also the per-route timeouts just default to 10 secs. No matter what we specifiy in the .post or .get call, it times out in 10 secs…
The assignment of timeout to the right class field in the method call seems ok, but is there maybe a ‘whichever triggers first’ timeout defined between global and per-route ?
It’s hitting us in some REST calls that need to collect a lot of async data.
For completeness, I’m going to point out that agent-server imposes an upper limit of 10 minutes for HTTP timeouts. If your squirrel doesn’t call res.send(...) by then, we’ll return a 504 with “HTTP Request Handler Timeout”. There may also be another timeout imposed by the front proxy configuration, but I don’t recall one right now.
It’s fixed in Rocky 3.0.1, which is currently in master in the repo. Might be worth grabbing the code manually – I can’t say when it’ll be uploaded to the server for delivery via #require (alas, I am not able to do this).