Increase stallTimeout for rpc - #76
Conversation
| makeWithOptions( | ||
| ~rpcUrl, | ||
| ~network, | ||
| ~options={staticNetwork: network, ?priority, stallTimeout: 30_000}, |
There was a problem hiding this comment.
I see we actually have backoff millis as an option in sync config for RPC. Maybe we should make this value a function of the config?
The question is should we hit our retry policy before the client tries on a different request (and only switch RPC after a given backoff)? Or should we let the client retry with different endpoint before hitting our own built in exponential backoff/retry.
|
|
||
| impl Default for SyncConfig { | ||
| fn default() -> Self { | ||
| let query_timeout_millis = 20_000; |
There was a problem hiding this comment.
Total nitpick 🤓 but this can be const instead of let and so can the division by 2. For inlining at compile time.
| query_timeout_millis, | ||
| fallback_stall_timeout: c | ||
| .fallback_stall_timeout | ||
| .unwrap_or_else(|| query_timeout_millis / 2), |
There was a problem hiding this comment.
Why not fallback to the sync config default? Otherwise need to remember to adjust this in 2 places if it ever changes.
There was a problem hiding this comment.
The idea is to default the value to the half of the query timeout
JonoPrest
left a comment
There was a problem hiding this comment.
Don't mind my nitpicking if you don't care. Otherwise looks great 😄
bf48b3b to
a0f2bf4
Compare
The amount of time to wait before kicking off the next provider.
Any providers that have not responded can still respond and be
counted, but this ensures new providers start.
Default: 400ms
Since it doesn't abort the request, maybe we should decrease the timeout to 20, or something?