Try Http outcalls in the local dfx environment, sometimes it fails:
timeout expired, I guess it is caused by the response taking too long, so how long can the response return time be tolerated locally or on the ic mainnet?
Considering the need to leave enough time for consensus, I guess it may be less than 0.5s? I didn’t find a specific description in how it works.
In addition, is it possible to allow subnet nodes to reach a consensus within
n blocks, such as 5 blocks, to relax the limit on the response return time? @dieter.sommer
The current timeout for consensus is 60 seconds. I.e., enough nodes need to receive a response within 60 seconds. This is not directly related to the block finalization rate, but a separate parameter. However, as it is done now, it is not possible to allow for requests to specify an alternative timeout. That would be a nice extension though!
But to your specific issue, the
timeout expired error may actually come from the HTTP adapter which means that the remote server has timed out, and not the HTTPS outcall. Could you share more detailed output?
On the local replica (launched with
dfx start), I’m getting the
SysFatal - Timeout expired error even though the service called by the HTTPS outcall (running on my computer) returns the response after max. 10 seconds.
I can confirm that it’s a timeout and not a transformation function issue (like the docs suggest), because if I make that service reply immediately with the same status and body, I don’t get the error.
Do you know why this happens? Maybe the local replica has a different timeout configuration?