Skip to content

Increase stallTimeout for rpc - #76

Merged
DZakh merged 4 commits into
mainfrom
dz/increase-rpc-timeout
Jul 26, 2024
Merged

Increase stallTimeout for rpc#76
DZakh merged 4 commits into
mainfrom
dz/increase-rpc-timeout

Conversation

@DZakh

@DZakh DZakh commented Jul 17, 2024

Copy link
Copy Markdown
Member

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?

@DZakh
DZakh requested a review from JonoPrest July 17, 2024 11:03
makeWithOptions(
~rpcUrl,
~network,
~options={staticNetwork: network, ?priority, stallTimeout: 30_000},

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@DZakh
DZakh requested a review from JonoPrest July 25, 2024 11:14

impl Default for SyncConfig {
fn default() -> Self {
let query_timeout_millis = 20_000;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Total nitpick 🤓 but this can be const instead of let and so can the division by 2. For inlining at compile time.

Comment on lines +430 to +435
query_timeout_millis,
fallback_stall_timeout: c
.fallback_stall_timeout
.unwrap_or_else(|| query_timeout_millis / 2),

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not fallback to the sync config default? Otherwise need to remember to adjust this in 2 places if it ever changes.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The idea is to default the value to the half of the query timeout

@JonoPrest JonoPrest left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't mind my nitpicking if you don't care. Otherwise looks great 😄

@DZakh
DZakh force-pushed the dz/increase-rpc-timeout branch from bf48b3b to a0f2bf4 Compare July 26, 2024 11:41
@DZakh
DZakh merged commit f8b3dc0 into main Jul 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants